2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-12 16:26:37 +00:00

Update documentation formatting

This commit is contained in:
Tomas Kirda 2015-06-04 12:45:36 -05:00
parent bd25b4d992
commit e150db1166

View File

@ -11,8 +11,9 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
* `$(selector).autocomplete(options);`
* Sets up autocomplete for input field(s).
* `options`: An object literal which defines the settings to use for the autocomplete plugin.
* __Ajax settings__
* `options`: An object literal which defines the settings to use for the autocomplete plugin. Available option settings listed below.
###Ajax Settings
* `serviceUrl`: Server side URL or callback function that returns serviceUrl string. Optional if local lookup data is provided.
* `type`: Ajax request type to get suggestions. Default: `GET`.
* `dataType`: type of data returned from server. Either 'text' (default) or 'jsonp', which will cause the autocomplete to use jsonp. You may return a json object in your callback when using jsonp.
@ -20,7 +21,8 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
* `params`: Additional parameters to pass with the request, optional.
* `deferRequestBy`: Number of miliseconds to defer ajax request. Default: `0`.
* `ajaxSettings`: Any additional [Ajax Settings](http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings) that configure the jQuery Ajax request.
* __Searching process__
###Configuration Settings
* `noCache`: Boolean value indicating whether to cache suggestion results. Default `false`.
* `delimiter`: String or RegExp, that splits input value and takes last part to as query for suggestions.
Useful when for example you need to fill list of coma separated values.
@ -39,7 +41,8 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
* `preventBadQueries`: Boolean value indicating if it shoud prevent future ajax requests for queries with the same root if no results were returned. E.g. if `Jam` returns no suggestions, it will not fire for any future query that starts with `Jam`. Default `true`.
* `autoSelectFirst`: if set to `true`, first item will be selected when showing suggestions. Default value `false`.
* `onHide`: `function (container) {}` called before container will be hidden
* __Displaying__
###Presentation Settings
* `beforeRender`: `function (container) {}` called before displaying the suggestions. You may manipulate suggestions DOM before it is displayed.
* `formatResult`: `function (suggestion, currentValue) {}` custom function to
format suggestion entry inside suggestions container, optional.