我使用tokenize2库进行多选。它对我来说很好,但我想在点击下拉菜单中显示所有项目。在tokenize2中有可能吗? 请帮我。
答案 0 :(得分:3)
在tokenize2.css文件中更改以下样式。它对我有用。
.tokenize-dropdown > .dropdown-menu {
min-height: 10px;
width: 100%;
display: block;
margin: -1px 0 0 0;
visibility: visible;
opacity: 1;
max-height: 200px !important;
overflow: auto; }
并在tokenize2.js文件中更改以下内容
if($('li.dropdown-item', this.dropdown).length <= this.options.dropdownMaxItems){
到
if ($('li.dropdown-item', this.dropdown).length <= items.length) {
答案 1 :(得分:0)
我知道我晚会晚了,但这对我有用。
$('Selector').on('tokenize:select', function(container) {
$(this).tokenize2().trigger('tokenize:search', [$(this).tokenize2().input.val()]);
});