ember-select-2 icon indicating copy to clipboard operation
ember-select-2 copied to clipboard

content field update for remote server data

Open chooli opened this issue 11 years ago • 1 comments

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?

chooli avatar Feb 05 '15 21:02 chooli

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 (?).

chvonrohr avatar Mar 18 '15 16:03 chvonrohr