A mixin that implements the base functionality to search a store based upon user-entered text such as with dijit/form/ComboBox or dijit/form/FilteringSelect
See the dijit/form/_SearchMixin reference documentation for more information.
Mixin to the store's fetch. For example, to set the sort order of the ComboBox menu, pass:
{ sort: [{attribute:"name",descending: true}] }
To override the default queryOptions so that deep=false, do:
{ queryOptions: {ignoreCase: true, deep: false} }
Set true if the query should ignore case when matching possible items
Alternate to specifying a store. Id of a dijit/form/DataList widget.
Argument to data provider. Specifies maximum number of search results to return per query
A query that can be passed to store
to initially filter the items.
ComboBox overwrites any reference to the searchAttr
and sets it to the queryExpr
with the user's input substituted.
This specifies what query is sent to the data store,
based on what the user has typed. Changing this expression will modify
whether the results are only exact matches, a "starting with" match,
etc.
${0}
will be substituted for the user text.
*
is used for wildcards.
${0}*
means "starts with", *${0}*
means "contains", ${0}
means "is"
Search for items in the data store where this attribute (in the item) matches what the user typed
Delay in milliseconds between when user types something and we start searching based on that value
Reference to data provider object used by this ComboBox.
The store must accept an object hash of properties for its query. See query
and queryExpr
for details.
Helper function to convert a simple pattern to a regular expression for matching.
Returns a regular expression object that conforms to the defined conversion rules. For example:
and so on.
Parameter | Type | Description |
---|---|---|
pattern | dojo/string | A simple matching pattern to convert that follows basic rules:
To use a \ as a character in the string, it must be escaped. So in the pattern it should be represented by \ to be treated as an ordinary \ character instead of an escape. |
Handles input (keyboard/paste) events
Parameter | Type | Description |
---|---|---|
evt | Event |
Starts a search for elements matching text (text=="" means to return all items), and calls onSearch(...) when the search completes, to display the results.
Parameter | Type | Description |
---|---|---|
text | String |
Callback when a search completes.
Parameter | Type | Description |
---|---|---|
results | Object | An array of items from the originating _SearchMixin's store. |
query | Object | A copy of the originating _SearchMixin's query property. |
options | Object | The additional parameters sent to the originating _SearchMixin's store, including: start, count, queryOptions. |