Replies: 2 comments
-
It works pretty much the same as selectize. It's easy to see in the Remote Data examples |
Beta Was this translation helpful? Give feedback.
-
In my case the second control is dynamically populated based upon a selection of the first control so the query is not known at the time of set up of the TomSelect(). I was using the load() function to dynamically load and populate the second control like this: Select Book, onChange -> fetch JSON and load the Chapters select with the JSON result. I think you are suggesting to use the load callback which does appear to be similar to Selectize, but Selectize also has the load method that allows you to load the control dynamically without any user input. |
Beta Was this translation helpful? Give feedback.
-
I am attempting to migrate over from Selectize, and found a breaking change... the load() function.
See https://github.com/selectize/selectize.js/blob/master/docs/api.md#methods_other
Selectize allows you to load the control by passing a function. This works great when you need to customize an AJAX fetch on the fly and the load the control.
TomSelect load method works differently by passing a query.
Consider two linked selects:
When the book is selected, you want to present the user with a list of chapters. I have not been able to see how this can be achieved with TomSelect -- maybe I am missing something. Thanks for your consideration on this.
Beta Was this translation helpful? Give feedback.
All reactions