我在用着Select2 http://ivaynberg.github.com/select2/来增强我的<select>
输入。我填充<options>
使用coldfusion和sql。我想用formatNoMatches
如果用户搜索中没有匹配项,则添加该选项。我不想使用多重选择,因为它不适用于我的 Coldfusion,而且只需添加一个单击事件即可更简单formatNoMatches
.
select2.js 中的某处有代码阻止鼠标事件发生formatNoMatches
。有没有办法破解它,允许鼠标事件?
$(".select").select2({
allowClear: true,
blurOnChange: true,
openOnEnter: false,
formatNoMatches: function(term) {
return "<a href='#' onclick='alert('" + term + "');'"
+ "id='newClient'>Add New Client</a>";
}
});
我无法让上面的代码来提醒任何事情。
这是 select2 的问题。同样存在一个错误。但到现在还没有解决办法。有一些想法,您可以在下面找到详细信息。
https://github.com/ivaynberg/select2/issues/276 https://github.com/ivaynberg/select2/issues/276
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)