Update README.md
This commit is contained in:
parent
8257cf7d44
commit
8eebb13b6b
@ -10,7 +10,7 @@ A JavaScript and CSS library for augmenting raw HTML inputs with modern search f
|
|||||||
|
|
||||||
* Support for locally rendered options and options returned via a GET request
|
* Support for locally rendered options and options returned via a GET request
|
||||||
|
|
||||||
###### Usage
|
###### Basic Usage
|
||||||
|
|
||||||
Include both the `SearchableInput.js` and `SearchableInput.css` files in your page's source and wrap any text input like the following:
|
Include both the `SearchableInput.js` and `SearchableInput.css` files in your page's source and wrap any text input like the following:
|
||||||
|
|
||||||
@ -25,6 +25,8 @@ Include both the `SearchableInput.js` and `SearchableInput.css` files in your pa
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
###### Shared Item Source
|
||||||
|
|
||||||
If multiple inputs require the same source of data, put your `div.item` options in a hidden div somewhere in the document accessible by its `id` attribute:
|
If multiple inputs require the same source of data, put your `div.item` options in a hidden div somewhere in the document accessible by its `id` attribute:
|
||||||
|
|
||||||
<div id="items-source">
|
<div id="items-source">
|
||||||
@ -40,6 +42,8 @@ Then, in the `div.items` container beneath the input, set its `data-source` attr
|
|||||||
<div class="items" data-source="#items-source"></div>
|
<div class="items" data-source="#items-source"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
###### Items from GET (application/json)
|
||||||
|
|
||||||
Alternatively, you can set the `data-source-api` to access a GET endpoint that responds with `application/json`:
|
Alternatively, you can set the `data-source-api` to access a GET endpoint that responds with `application/json`:
|
||||||
|
|
||||||
<div class="searchable-input">
|
<div class="searchable-input">
|
||||||
|
Loading…
Reference in New Issue
Block a user