Skip to content

Commit

Permalink
Close #53
Browse files Browse the repository at this point in the history
  • Loading branch information
xcash committed May 4, 2020
1 parent 97579b8 commit 973dafe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/latest/bootstrap-autocomplete.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/latest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h4 class="modal-title">Modal title</h4>

$('.basicAutoCompleteShowBtn').on('click', function () {
console.log('click');
$('.basicAutoCompleteShowDropdown').trigger('keyup');
$('.basicAutoCompleteShowDropdown').autoComplete('show');
});

// Advanced 1
Expand Down
11 changes: 11 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,17 @@ To clear the value.
// or
$('.myAutoSelect').autoComplete('clear');
Show autocomplete
*****************

Sometimes is useful to programmatically show suggestions.
To achieve this set a ``minLength`` of ``0``, server side acts accordingly with a ``qry`` value of ``''``, call the following method:

.. code-block:: javascript
$('.myAutoSelect').autoComplete('show');
Customize results using default AJAX resolver
*********************************************

Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h4 class="modal-title">Modal title</h4>

$('.basicAutoCompleteShowBtn').on('click', function () {
console.log('click');
$('.basicAutoCompleteShowDropdown').trigger('keyup');
$('.basicAutoCompleteShowDropdown').autoComplete('show');
});

// Advanced 1
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ export class AutoComplete {
} else if (APICmd === 'clear') {
// shortcut
this.itemSelectedDefaultHandler(null);
} else if (APICmd === 'show') {
// shortcut
this._$el.trigger('keyup');
}
}

Expand Down

0 comments on commit 973dafe

Please sign in to comment.