Searches records in the grid.
search(field, value)

field | string, 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: search = { field : '', // search field name value : '', // field value (array of two values for operators: between, in) type : '', // type of the field, if not defined search.type for the field will be used operator : '' // search operator, can be 'is', 'between', 'begins with', 'contains', 'ends with' // if not defined it will be selected based on the type } If you have a grid defined in the following way: $('#grid').w2grid({ name : 'grid', columns: [ { field: 'recid', caption: 'ID', size: '50px' }, { field: 'lname', caption: 'Last Name', size: '30%' }, { field: 'fname', caption: 'First Name', size: '30%' }, { field: 'email', caption: 'Email', size: '40%' }, { field: 'sdate', caption: 'Start Date', size: '120px' }, { field: 'sdate', caption: 'End Date', size: '120px' } ], records: [ { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' }, { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' }, { recid: 3, fname: 'Jin', lname: 'Franson', email: '--', sdate: '4/23/2012' }, { recid: 4, fname: 'Susan', lname: 'Ottie', email: 'jdoe@gmail.com', sdate: '5/3/2012' }, { recid: 5, fname: 'Kelly', lname: 'Silver', email: 'jdoe@gmail.com', sdate: '4/3/2012' }, { recid: 6, fname: 'Francis', lname: 'Gatos', email: 'vitali@gmail.com', sdate: '2/5/2012' } ] }); You can do following searches: grid.search('fname', 'm'); // or grid.search('all', 'm'); // or grid.search([{ field: 'date', value: ['1/1/2012', '1/10/2012'], operator: 'between'}], 'OR');