Searches records in the grid.
search([field], value)
field |
string, optional name of the search field |
value |
string, value of the search field |
OR
search(searches, [logic])
searches |
array, array of search objects |
logic |
string, defines search logic AND/OR (optional) |
Returns
undefined.
Description
This method will generate
.searchData array of objects, apply the search and refresh the grid.
If the data source is local, it will call
.localSearch method. If the data source is remote
it will submit search data to the server side to apply the search.
If the first argument
field is string then it is the name of the
search field or 'all' to search all applicable fields (search fields where data type matches). The second argument
value is the search string.
If the first argument is an array and second optional argument is a string (AND or OR), then the method will assume that it is the array
of search objects. This way you can submit search on multiple fields at the same time.
The search object has the following structure:
If you have a grid defined in the following way:
You can do following searches: