Toggles a search between hidden and shown states.
toggleSearch(field, [field], ...)

field | string, field name of the column

Returns integer.

#### Description

This method will show the search if it was previously hidden and hide the search if it was previously shown. If the search field is hidden, it will not be visible when user opens search overlay and will not display the field if user clicks magnifying glass icon. Returns the number of toggled searches.
If you have 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' } ], columns: [ { field: 'recid', caption: 'ID', type: 'text' }, { field: 'lname', caption: 'Last Name', type: 'text' }, { field: 'fname', caption: 'First Name', type: 'text' } ], 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 toggle columns by: w2ui['grid'].toggleSearch('recid', 'fname');