Show all options in tokenize2

670 views Asked by At

I am using tokenize2 library for multiselection. It works fine for me but I want to show all items in dropdown on click. Is it possible in tokenize2? please help me.

2

There are 2 answers

0
Stephen M On

Change the following style on your tokenize2.css file. It works for me.

.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; } 

And change on tokenize2.js file the following

if($('li.dropdown-item', this.dropdown).length <= this.options.dropdownMaxItems){

to

if ($('li.dropdown-item', this.dropdown).length <= items.length) {
0
Jayz On

I know I am late to the party but this worked for me.

$('Selector').on('tokenize:select', function(container) {
    $(this).tokenize2().trigger('tokenize:search', [$(this).tokenize2().input.val()]);
});