I am using jqGrid [3.7.1] and on that using below code to hide some columns
jQuery("#gridId").jqGrid('hideCol', ["Col5", "Col7", "Col9"]);
And we also have filterToolbar applied but when we are executing search , I can see that it's searching on different/hidden columns.
On inspecting I can see that TH under TR with class ui-jqgrid-labels for hidden columns display: none; style attribute gets added.
But for same column TH under TR with class ui-search-toolbar noting gets added and resulting in
<td role="columnheader" class="ui-state-default ui-th-column ui-th-ltr">
<div style="width:100%;position:relative;height:100%;padding-right:0.3em;">
<input type="text" style="width:100%;padding:0px;" name="Id" id="**gs_Col5**" value="" spellcheck="false">
</div>
</td>
Where actual column header under Col6 and Col5 is hidden.
Any idea how to resolve it?
First of all this is very old version.
Second - filterTollbar is a search method which apply only by the column on which search is performed - by example if you search on Col1, then the search is only applied to that column. It is not possible to search on hidden columns.
The only way this to happen is when you initially search on Col1, then hide that column without to clear the search filter and then apply search on Col2 - if this is the case then you search wil be on column 1 and 2.
To overcome this, be a sure that before to hide some column you clear its search value with refreshing the search