选择2 Plugin Jquery,显示默认消息
我正在使用select2插件显示自动建议的下拉列表和标签 下面是我的代码的外观:选择2 Plugin Jquery,显示默认消息,jquery,jquery-select2,Jquery,Jquery Select2,我正在使用select2插件显示自动建议的下拉列表和标签 下面是我的代码的外观: $('.select2Member').select2({ multiple: true, minimumInputLength :1, placeholder : cake.message.notice.b, ajax { url ": cake.url.a , dataType : json,
$('.select2Member').select2({
multiple: true,
minimumInputLength :1,
placeholder : cake.message.notice.b,
ajax {
url ": cake.url.a ,
dataType : json,
quietMillis : 100,
cache : true,
data :function(term,page){
return{
term: term,
page_limit : 10
};
}
}
});
除字段为空外,所有操作都正常。只有在该字段为空时,才会显示下拉消息“未找到匹配项”
我想在字段为空时删除默认消息
我已尝试将以下参数添加到Jquery:
tags:[''],
tokenSeparators: [','],
formatNoMatches: function() {
return '';
},
dropdownCssClass: 'select2-hidden'
还添加了一个类select2隐藏显示:无!重要属性
在上述情况下,它会被隐藏,但即使搜索成功,它也不会显示
如有任何专家建议,将不胜感激 使用合适的标签,我已经编辑过了。这与CakePHP无关,也与php无关!你能在JSFIDLE上复制同样的功能吗,