Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop down option list does not change when new populate (via JSON) is called #321

Open
SentencedToCode opened this issue Feb 23, 2015 · 0 comments

Comments

@SentencedToCode
Copy link

SentencedToCode commented Feb 23, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant