selectize.js icon indicating copy to clipboard operation
selectize.js copied to clipboard

Re initialize with all options in the select

Open andriijas opened this issue 12 years ago • 5 comments

When a select is updated with new options, how can i re initialize the selectize instance to have the selectize updated with all the new options in the select? refreshOptions doesnt seem to do it and destroying the selectize and instansiating it again seems to remove all options.

Thanks

andriijas avatar May 22 '14 06:05 andriijas

Are you changing the options or the items (setValue / clear)? If the latter, try calling refreshItems() afterwards. (#438)

nlwillia avatar May 23 '14 23:05 nlwillia

Were you able to get this to work I am having the same issue. I get a list but the most accurate answer highlights, but does not come to the top. For example if I search New Zealand, New York populates to the top of the list and I have to scroll to New Zealand.

shannahutch avatar Aug 18 '14 22:08 shannahutch

Same issue. Here is a fiddle showing the issue.

http://jsfiddle.net/vb7a81er/2/

bubb-rubb avatar Dec 15 '14 20:12 bubb-rubb

It sounds like @andriijas was asking for the ability to reload the state of the select element from which it was originally initialized in order to pick up new or changed options. That feature is also discussed in issue #991.

mcavalletto avatar Apr 22 '16 01:04 mcavalletto

closing stale issues older than one year. If this issue was closed in error please message the maintainers. All issues must include a proper title, description, and examples.

risadams avatar Nov 12 '20 12:11 risadams