Skip to content

Commit

Permalink
programmatically show example
Browse files Browse the repository at this point in the history
  • Loading branch information
xcash committed May 1, 2020
1 parent 6a75ed6 commit 97579b8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dist/latest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ <h1 class="border-bottom">Bootstrap Autocomplete (for Bootstrap version 4)</h1>
<input class="form-control advanced2AutoComplete" type="text" autocomplete="off">
</div>
</div>
<div class="form-row mb-3">
<label class="col-lg-3">
Show dropdown programmatically.
</label>
<div class="col-lg-7">
<input class="form-control basicAutoCompleteShowDropdown" data-url="testdata/test-list.json" type="text" autocomplete="off">
</div>
<div class="col-lg-2">
<button type="button" class="btn btn-block btn-outline-secondary basicAutoCompleteShowBtn">
Show
</button>
</div>
</div>
</fieldset>
<fieldset>
<legend class="border-bottom">
Expand Down Expand Up @@ -199,6 +212,15 @@ <h4 class="modal-title">Modal title</h4>
$('.basicAutoCompleteSelected').html('');
});

$('.basicAutoCompleteShowDropdown').autoComplete({
minLength: 0,
});

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

// Advanced 1
$('.advancedAutoComplete').autoComplete({
resolver: 'custom',
Expand Down
22 changes: 22 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ <h1 class="border-bottom">Bootstrap Autocomplete (for Bootstrap version 4)</h1>
<input class="form-control advanced2AutoComplete" type="text" autocomplete="off">
</div>
</div>
<div class="form-row mb-3">
<label class="col-lg-3">
Show dropdown programmatically.
</label>
<div class="col-lg-7">
<input class="form-control basicAutoCompleteShowDropdown" data-url="testdata/test-list.json" type="text" autocomplete="off">
</div>
<div class="col-lg-2">
<button type="button" class="btn btn-block btn-outline-secondary basicAutoCompleteShowBtn">
Show
</button>
</div>
</div>
</fieldset>
<fieldset>
<legend class="border-bottom">
Expand Down Expand Up @@ -199,6 +212,15 @@ <h4 class="modal-title">Modal title</h4>
$('.basicAutoCompleteSelected').html('');
});

$('.basicAutoCompleteShowDropdown').autoComplete({
minLength: 0,
});

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

// Advanced 1
$('.advancedAutoComplete').autoComplete({
resolver: 'custom',
Expand Down

0 comments on commit 97579b8

Please sign in to comment.