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.
@@ -51,6 +51,7 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
51
51
Set this option to force auto positioning in other cases.
52
52
*`orientation`: Default `bottom`. Vertical orientation of the displayed suggestions, available values are `auto`, `top`, `bottom`.
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
+
*`onHide`: `function (container) {}` called before container will be hidden
54
55
55
56
Autocomplete instance has following methods:
56
57
@@ -62,7 +63,7 @@ Autocomplete instance has following methods:
62
63
*`hide`: hides suggestions.
63
64
*`dispose`: destroys autocomplete instance. All events are detached and suggestion containers removed.
64
65
65
-
There are two ways that you can invoke Autocomplete method. One is calling autocomplete on jQuery object and passing method name as string literal.
66
+
There are two ways that you can invoke Autocomplete method. One is calling autocomplete on jQuery object and passing method name as string literal.
66
67
If method has arguments, arguments are passed as consecutive parameters:
67
68
68
69
$('#autocomplete').autocomplete('disable');
@@ -134,8 +135,8 @@ Response from the server must be JSON formatted following JavaScript object:
134
135
]
135
136
}
136
137
137
-
Data can be any value or object. Data object is passed to formatResults function
138
-
and onSelect callback. Alternatively, if there is no data you can
138
+
Data can be any value or object. Data object is passed to formatResults function
139
+
and onSelect callback. Alternatively, if there is no data you can
139
140
supply just a string array for suggestions:
140
141
141
142
{
@@ -167,10 +168,10 @@ If you use it with jQuery UI library it also has plugin named `autocomplete`. In
167
168
168
169
##License
169
170
170
-
Ajax Autocomplete for jQuery is freely distributable under the
171
+
Ajax Autocomplete for jQuery is freely distributable under the
171
172
terms of an MIT-style [license](https://github.com/devbridge/jQuery-Autocomplete/blob/master/dist/license.txt).
172
173
173
-
Copyright notice and permission notice shall be included in all
174
+
Copyright notice and permission notice shall be included in all
0 commit comments