Array of search objects (submitted to data source for record filtering).
Array, default = []
When user executes a search the grid will generate the array of search objects. User can execute a search in a variety of ways: by typing in global search field, selecting a field and typing search text, or clicking the "Search..." button and submitting a multi-field search. Regardless of the way, the grid will generate the search array.
As a developer you can define initial searches during object creation: $('#grid').w2grid({ name : 'grid', url : 'server/side/path/to/records', 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: '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: 'jdoe@gmail.com', 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' } ], searchData : [ { field : 'fname', value : 'j', operator : 'contains', type: 'text' } ] }); Even though you created initial search, the user can clear or overwrite it. You can defined some search fields as hidden if you want to prevent user from messing up your search, or you can add search data into .postData object which will get submitted to the server and will not allow user to clear it.
The structure of the search object is: search = { field : '', // search field name value : '', // string or array of string with values operator : 'is', // search operator [is, in, between, begins with, contains, ends with] type : '' // data type, [text, int, float, date] } You can use .search() method to submit searches.