im trying to inplement this array to jQuery SumoSelect librery
var devices= [{
text: "iphone",
value:"iphone"
},
{
text: "android",
value:"android"
},
{
text: "mac",
value:"mac"
}]
im reading it with the following code
$("select").SumoSelect({search: true, searchText: 'search'});
for(var i in devices){
$(".type-vehicle").append("<option>"+devices[i].text+"</option>");
}
it shows me an empty select but if i just do it without SumoSelect librery it works perfectly, i mean it shows me the select inputs with the 3 devices.
do you guys know what`s going on? why is rejecting me the array with the SumoSelect librery? thanks!
You need to populate the select box first, then invoke SumoSelect. You almost had it!