ember-select-2
ember-select-2 copied to clipboard
content field update for remote server data
I found the value binding doesn't update when used "typeahead" mode. I implemented "queryOptions" in the controller and retrieve server data. Then transformed the data into key-value array. This worked fine till I choose one option and it got an error.
I debugged it and found the content field in this plugin was empty since I didn't assign it. I now just fix it by setting it in the following codes
... ...
deferred.promise.then(function(data) {
if (data instanceof Ember.ArrayProxy) {
data = data.toArray();
}
//fix for server return updates array
self.set('content', data);
query.callback({
results: data
});
... ...
Not sure if it is the right way or do I need to implement my own initSelection method. How to initiate the first time render select2 component?
Had the same problem and your fix did it. Thanks a lot! By now I had no drawbacks and I think this should be merged (?).