Can someone show me some sample code on how to repopulate the drop down option list on selecBoxIt control? This list populates perfectly from a JSON object, but when I remove, populate, refresh, I am left with an empty list:
$("#selSM4").data("selectBox-selectBoxIt").remove();
$("#selSM4").selectBoxIt({
populate: function () { var deferred = $.Deferred(), arr = [], x = -1;
$.ajax({ url: 'http://localhost:58933/home/AllSchoolList?subject'
}).done(function (data) {
while (++x < data.length) {
arr.push({text: data[x].name, value: data[x].value,
}); }
deferred.resolve(arr);
});
return deferred; }
});
$("#selSM4").data("selectBox-selectBoxIt").refresh();
The "populate" works initially. Why not when i try to "populate" with a different list?
Can someone show me some sample code on how to repopulate the drop down option list on selecBoxIt control? This list populates perfectly from a JSON object, but when I remove, populate, refresh, I am left with an empty list: $("#selSM4").data("selectBox-selectBoxIt").remove(); $("#selSM4").selectBoxIt({ populate: function () { var deferred = $.Deferred(), arr = [], x = -1; $.ajax({ url: 'http://localhost:58933/home/AllSchoolList?subject' }).done(function (data) { while (++x < data.length) { arr.push({text: data[x].name, value: data[x].value, }); } deferred.resolve(arr); }); return deferred; } }); $("#selSM4").data("selectBox-selectBoxIt").refresh(); The "populate" works initially. Why not when i try to "populate" with a different list?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.