Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/talyssonoc/jsautosuggest
Autosuggest JavaScript tool using jsT9
https://github.com/talyssonoc/jsautosuggest
Last synced: 21 days ago
JSON representation
Autosuggest JavaScript tool using jsT9
- Host: GitHub
- URL: https://github.com/talyssonoc/jsautosuggest
- Owner: talyssonoc
- Created: 2013-09-10T00:05:15.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-08T00:31:00.000Z (almost 11 years ago)
- Last Synced: 2024-10-04T16:50:36.782Z (about 1 month ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jsAutoSuggest
=============Autosuggest JavaScript tool using [jsT9](https://github.com/talyssonoc/jsT9 "jsT9")
Usage
=====1. Create a [jsT9](https://github.com/talyssonoc/jsT9 "jsT9") tree with the words
2. Create a new jsAutoSuggest object, passing the field from where the input will be taken and where the suggestion box will be appended, the tree (or the path of a JSON file with the words, see [jsT9](https://github.com/talyssonoc/jsT9 "jsT9") documentation), and a custom settings object if needed (the settings documentation is in the next section).
3. Run the method init() of jsAutoSuggest.For more info, see the example.
Custom settings
===============## Calbacks
* `select`: A function (that receiva a word as argument) that runs after the user clicks an suggestion.
* `create`: Function (that receive a suggestion HTML element as argument) that will be applied to any of the suggestions of the menu.
* `show`: Function that runs right after the list is showed## Options
* `suggestionClass`: String with one or more classes (separated with spaces) to any of the options of the suggestion menu.
* `hideOnChoose`: Hides the suggestion menu when the user clicks on some of them. (Default: true).
* `fillOnChoose`: Fills the field with the option when it's choosen. (Default: true).
* `hideOnClickOutside`: Hides the suggestion menu when the user clicks out of it. (Default: true).
* `debounce`: Debounces the showing of the list of suggestions. (Default: false).
* `debounceTime`: Time of debouncing in milliseconds. (Default: 500).
* `treeOptions`: Used to build the tree (but not required) if a JSON file path is passed as second argument.API
===* `init`: Start the jsAutoSuggest use.
* `show(text)`: Show the list of suggestions for the given text. If text is not passed, it takes the current field value.
* `hide`: Hides the list of suggestions.