You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
#Ajax AutoComplete for jQuery
2
2
3
-
Ajax Autocomplete for jQuery allows you to easily create
3
+
Ajax Autocomplete for jQuery allows you to easily create
4
4
autocomplete/autosuggest boxes for text input fields.
5
5
6
6
Has no dependencies other than jQuery.
@@ -18,15 +18,15 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
18
18
*`suggestion`: An object literal with the following format: `{ value: 'string', data: any }`.
19
19
*`lookupFilter`: `function (suggestion, query, queryLowerCase) {}` filter function for local lookups. By default it does partial string match (case insensitive).
20
20
*`lookupLimit`: Number of maximum results to display for local lookup. Default: no limit.
21
-
*`onSelect`: `function (suggestion) {}` Callback function invoked when user selects suggestion
21
+
*`onSelect`: `function (suggestion) {}` Callback function invoked when user selects suggestion
22
22
from the list. `this` inside callback refers to input HtmlElement.
23
23
*`minChars`: Minimum number of characters required to trigger autosuggest. Default: `1`.
24
24
*`maxHeight`: Maximum height of the suggestions container in pixels. Default: `300`.
25
25
*`deferRequestBy`: Number of miliseconds to defer ajax request. Default: `0`.
26
26
*`width`: Suggestions container width in pixels, e.g.: 300. Default: `auto`, takes input field width.
27
27
*`params`: Additional parameters to pass with the request, optional.
28
-
*`formatResult`: `function (suggestion, currentValue) {}` custom function to
29
-
format suggestion entry inside suggestions container, optional.
28
+
*`formatResult`: `function (suggestion, currentValue) {}` custom function to
29
+
format suggestion entry inside suggestions container, optional.
30
30
*`delimiter`: String or RegExp, that splits input value and takes last part to as query for suggestions.
31
31
Useful when for example you need to fill list of coma separated values.
32
32
*`zIndex`: 'z-index' for suggestions container. Default: `9999`.
@@ -37,7 +37,7 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
37
37
*`onSearchError`: `function (query, jqXHR, textStatus, errorThrown) {}` called if ajax request fails. `this` is bound to input element.
38
38
*`onInvalidateSelection`: `function () {}` called when input is altered after selection has been made. `this` is bound to input element.
39
39
*`triggerSelectOnValidInput`: Boolean value indicating if `select` should be triggered if it matches suggestion. Default `true`.
40
-
*`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`.
40
+
*`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`.
41
41
*`beforeRender`: `function (container) {}` called before displaying the suggestions. You may manipulate suggestions DOM before it is displayed.
42
42
*`tabDisabled`: Default `false`. Set to true to leave the cursor in the input field after the user tabs to select a suggestion.
43
43
*`paramName`: Default `query`. The name of the request parameter that contains the query.
@@ -53,6 +53,7 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
53
53
If set to `auto`, the suggestions will be orientated it the way that place them closer to middle of the view port.
54
54
*`groupBy`: property name of the suggestion `data` object, by which results should be grouped.
55
55
*`preserveInput`: if `true`, input value stays the same when navigating over suggestions. Default: `false`.
56
+
*`onHide`: `function (container) {}` called before container will be hidden
56
57
57
58
Autocomplete instance has following methods:
58
59
@@ -64,7 +65,7 @@ Autocomplete instance has following methods:
64
65
*`hide`: hides suggestions.
65
66
*`dispose`: destroys autocomplete instance. All events are detached and suggestion containers removed.
66
67
67
-
There are two ways that you can invoke Autocomplete method. One is calling autocomplete on jQuery object and passing method name as string literal.
68
+
There are two ways that you can invoke Autocomplete method. One is calling autocomplete on jQuery object and passing method name as string literal.
68
69
If method has arguments, arguments are passed as consecutive parameters:
69
70
70
71
```javascript
@@ -177,8 +178,8 @@ Response from the server must be JSON formatted following JavaScript object:
177
178
}
178
179
```
179
180
180
-
Data can be any value or object. Data object is passed to formatResults function
181
-
and onSelect callback. Alternatively, if there is no data you can
181
+
Data can be any value or object. Data object is passed to formatResults function
182
+
and onSelect callback. Alternatively, if there is no data you can
0 commit comments