-
version: 2.0.0-rc.4 const tom = new TomSelect(this.element, {
valueField: 'id',
labelField: 'name',
searchField: 'name',
maxItems: 1
});
try {
// TODO: tom.setLoadingState();
const response = await fetch(this.urlValue);
const json = await response.json();
tom.setupOptions(json);
// TODO: tom.setFinishedLoadingState();
} catch (error) {
} Basically I need to populate tomselect externally, and those are remote/asynchronous, so they are waiting I want to put tomselect to the loading state. I tried Basically I'm looking for a less hacky way to control the loading state. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Take a look at the "load once" example on https://tom-select.js.org/examples/remote/ |
Beta Was this translation helpful? Give feedback.
Take a look at the "load once" example on https://tom-select.js.org/examples/remote/