Class ZmSearchAutocomplete
This class supports auto-complete for our query language. Each search operator that is supported has an associated handler.
A handler is a hash which contains the info needed for auto-complete. A handler can have the following properties:
- listType - A handler needs a list of objects to autocomplete against. By default, that list is
identified by the operator. If more than one operator uses the same list, their handlers
should use this property to identify the list.
- loader - Function that populates the list of objects. Lists used by more than one operator provide
their loader separately.
- text - Function that returns a string value of data, to autocomplete against and to display in the
autocomplete list.
- icon - Function that returns an icon to display in the autocomplete list.
- matchText - Function that returns a string to place in the input when the item is selected. Defaults to
the 'op:' plus the value of the 'text' attribute.
- quoteMatch - If
true , the text that goes into matchText will be place in double quotes.
Defined in: ZmAutocomplete.js.
Class Summary
Constructor Attributes |
Constructor Name and Description |
|
Creates a search auto-complete.
|
Method Summary
Method Attributes |
Method Name and Description |
|
Returns a list of matches for a given query operator.
|
Class Detail
ZmSearchAutocomplete()
Creates a search auto-complete.
Method Detail
autocompleteMatch(str, callback, aclv, options)
Returns a list of matches for a given query operator.
- Parameters:
-
{String} str
- the string to match against
-
{closure} callback
- the callback to run with results
-
{ZmAutocompleteListView} aclv
- needed to show wait msg
-
{Hash} options
- a hash of additional options
|