You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the jQuery initialization code, you can create a Selectize instance from a source select element or text field.
However, once you've done that, the synchronization after that is is only from Selectize to the corresponding element -- you can not ask the Selectize element to re-load its state from the source element, and it does not monitor the original element for events that would indicate new options have arrived or the selected items have changed.
It seems like it should be feasible to migrate the init_textbox and init_select logic and the corresponding initialization code from the $.fn.selectize function into the Selectize object itself, allowing that code to be re-used later if an external piece of code update the source element (such as a third-party function loading new options into the select) and we wished to update the Selectize control to reflect those changes.
(Suggestion prompted because I am migrating some pages over from Chosen.js to Selectize.js, and this functionality is already present in Chosen.js.)
The text was updated successfully, but these errors were encountered:
I agree completely, I had that impression when reading the source code and thinking about a refactor–break-down that the "initializing a selectize based on element" should be closer to the core. I would certainly be glad to see steps in that direction, those functions being ideally enclosed in a module/object that we'd then mix-in.
We have removed chosen.js in favor of selectize.js. You can update a selectize widget via API calls, there's just not a single-step "re-initialize from the source element" shortcut — you have to individually add or remove items one at a time.
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.
Using the jQuery initialization code, you can create a Selectize instance from a source select element or text field.
However, once you've done that, the synchronization after that is is only from Selectize to the corresponding element -- you can not ask the Selectize element to re-load its state from the source element, and it does not monitor the original element for events that would indicate new options have arrived or the selected items have changed.
It seems like it should be feasible to migrate the
init_textbox
andinit_select
logic and the corresponding initialization code from the$.fn.selectize
function into the Selectize object itself, allowing that code to be re-used later if an external piece of code update the source element (such as a third-party function loading new options into the select) and we wished to update the Selectize control to reflect those changes.(Suggestion prompted because I am migrating some pages over from Chosen.js to Selectize.js, and this functionality is already present in Chosen.js.)
The text was updated successfully, but these errors were encountered: