I want to create a custom smart select that populates virtual list from data that loads after hitting a API.
I’m not able to understand how to populate data in smart select. Kindly help
I’ve tried this until now:
app.request.get('https://mmv/150/dummyurl',
function (data, status) {
var data = JSON.parse(data);
if (data.code == 1 && data.message == "success") {
modelnames = data.data;
}
if (modelnames.length !== 0) {
smartSelect = app.smartSelect.create({
el: $$('#add-smartsel > a'),
virtualList: true,
closeOnSelect: true,
renderItems: function(items) {
console.log(items);
}
})
}
},
function (error, xhr) {
console.log(error);
})