dipson88 / treeselectjs

Treeselect on vanilla JS
MIT License
83 stars 15 forks source link

How to add/remove options #81

Closed florisschild closed 1 year ago

florisschild commented 1 year ago

Hey, First of all, thanks for all the work. I realy like this lib!

I have one question that i could not figure out in the documentation. What do i have to do if i want to add or remove options to the list?

Thanks,

Floris

dipson88 commented 1 year ago

Hi @florisschild, thank you!

So if you mean options prop, you need change your options array and then set the new array to the tree select, and then call treeselect.mount()

Here is an example form documentation: mount - Helps to remount and update settings. Change the settings you need (treeselect.appendToBody = true), then call mount().

Let me know if it helps.

florisschild commented 1 year ago

@dipson88 Thanks, i wasn't sure this would also work for the options property.