how to trigger selectize input to make options shown initially

坚强是说给别人听的谎言 提交于 2021-02-10 09:28:29

问题


I'm using selectize, and I want to show a few options without clicking selectize input. So I use $('.selectize-input').click() but it doesn't work. How to show a few options without clicking input?


回答1:


Assuming that you bind selectize plugin something like $('.selectize-input').selectize(options), you should be able to use API's open method like this:

$('.selectize-input')[0].open();


来源:https://stackoverflow.com/questions/31687392/how-to-trigger-selectize-input-to-make-options-shown-initially

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!