Skip to content

Commit

Permalink
Improve selectizer options
Browse files Browse the repository at this point in the history
by allowing multi-select lists and control over some more options:

- `maxOptions`: using `data-max-options`
- `maxItems`: using `data-max-items`
- `hideSelected`: using `data-hide-selected`
- `closeAfterSelect`: using `data-close-after-select`
  • Loading branch information
jadb committed Feb 14, 2016
1 parent 391e980 commit f67b4c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webroot/js/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ $(document).on('ready', function() {
$('input.autocomplete, select.autocomplete').each(function (i, e) {
e = $(e);
e.selectize({
maxItems: 1,
create: !$(e).data('exact-match'),
maxItems: e.data('max-items') || 1,
maxOptions: e.data('max-options') || 10,
hideSelected: e.data('hide-selected'),
closeAfterSelect: e.data('close-after-select'),
create: !e.data('exact-match'),
persist: false,
render: {
'option_create': function(data, escape) {
Expand Down

0 comments on commit f67b4c6

Please sign in to comment.