Reinitialized tom select using class name #378
-
I'm using tom-select forEach class name, like this:
then I want to change the value based on other option. How can I do it? I got error "Tom Select already initialized on this element". I don't know how to destroy(). Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Have you found any solution? I try this
but this always returns null |
Beta Was this translation helpful? Give feedback.
-
I've found the solution. for my case it's: |
Beta Was this translation helpful? Give feedback.
I've found the solution.
for my case it's:
document.querySelectorAll('.select').forEach((el)=>{ if (el.tomselect) { let control = el.tomselect; control.destroy(); } let settings = {}; new TomSelect(el,settings); });