-
Notifications
You must be signed in to change notification settings - Fork 12
Grid Query Options and Syntax
By default, the Grid Query functionality is disabled. To enable the query engine simply set the key "query" in the options to a truthy value
{
"query": true
}
this is equivalent to
{
"query": {
"tags": true,
"bar": true,
"filter": true
}
}
Three distinct components can be enabled/disabled independently
"tags" - this is a list of interactive chips or tags representing each query object
"bar" - this is a text representation of the queries and allows for general search across all fields
"filter" - this is a custom filter for each field that allows for customized interactions such as ranges and multiple selections and exceptions
To apply a query programmatically set the query string by
myGrid._query.string = "field:value"
A string that contains a ':' like title:new
will search the key "title" with a value of "new"
To return items that exclude the value use a negative ('-') at the beginning of the key like -title:new
If the search term contains a space it should be put in quotes title:"new item"
To search multiple terms you can separate them with a comma (',')
if the field that is being searched is a text field the search will be fuzzy if it is options based then an exact match is the default, to force one or the other replace ':' with '~' for fuzzy and '=' for exact
fields of type 'number' and 'date' also support ranges that can be defined like
range:[<min>, <max>]
number:[3 - 5]
for numbers >= 3 and <= 5
date:[2020-01-01 - 2020-10-01]
for dates >= 2020-01-01 and <= 2020-10-01
either (min, max) can be omitted and only the remaining condition will be evaluated