在我的select2中,我使用minimumInputLength选项在一定长度后开始过滤。Select2 minimumInputLength不工作追加()
selectExample.select2({
minimumInputLength: 2
});
但是在用append()函数动态追加新选项后,这个minimumInputLength选项不起作用。
selectExample.append('<option value="10">Ten</option>');
究竟发生了什么事?有没有特定的方法来为select2添加新选项?
我使用的当前解决方案是使用包含的minimumInputLength选项来重新声明.select2()。
这里看看:[http://stackoverflow.com/a/17348414/4202224](http://stackoverflow.com/a/17348414/4202224)或查看select2的'data'选项 – empiric 2015-02-23 08:57:27