Love SelectBoxIt. Able to populate drop down menu items (1100+) from JSON object using
selSM4 = $("#selSM4").selectBoxIt({
populate: function () {
var deferred = $.Deferred(), arr = [], x = -1;
$.ajax({
url: 'http://localhost:58933/home/AllSchoolList?subject=math&year=2013-2014'
}).done(function (data) {
while (++x < data.length)
{
arr.push({
text: data[x].name,
value: data[x].value,
title: data[x].title
});
}
deferred.resolve(arr);
});
return deferred;
}
});
But I am unable to subsequently change drop down menu items with same method. Only way I can get it to work is .remove, then loop through JSON object and .add row by row (takes too long). Any ideas?
Love SelectBoxIt. Able to populate drop down menu items (1100+) from JSON object using selSM4 = $("#selSM4").selectBoxIt({ populate: function () { var deferred = $.Deferred(), arr = [], x = -1; $.ajax({ url: 'http://localhost:58933/home/AllSchoolList?subject=math&year=2013-2014' }).done(function (data) { while (++x < data.length) { arr.push({ text: data[x].name, value: data[x].value, title: data[x].title }); } deferred.resolve(arr); }); return deferred; } }); But I am unable to subsequently change drop down menu items with same method. Only way I can get it to work is .remove, then loop through JSON object and .add row by row (takes too long). Any ideas?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.