harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.
http://harvesthq.github.io/chosen/
Other
21.85k stars 4.1k forks source link

How to deactive plugin #3114

Closed new-furry closed 3 years ago

new-furry commented 3 years ago

I wanna deactive plugin when some conditions change. plugin should support that function. I am not sure if I didn't find that function. could you pls help me this? It's pretty urgent. thx

tjschuck commented 3 years ago

Mark the underlying select as disabled, and then trigger chosen:updated: https://harvesthq.github.io/chosen/options.html#triggerable-events

new-furry commented 3 years ago

Hi @tjschuck . thanks for your quick response. But I still need to use select tag. I need to deactive plugin just.

new-furry commented 3 years ago

also, your solution is not working...

tjschuck commented 3 years ago

https://harvesthq.github.io/chosen/#change-update-events

chosen("destroy") to destroy Chosen and revert back to the native select.

new-furry commented 3 years ago

great!. it works. thank you @tjschuck