gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

Unable to change drop down options using deferred.resolve method #313

Open SentencedToCode opened 9 years ago

SentencedToCode commented 9 years ago

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.