If you use low-level methods showCol, hideCol, showHideCol directly then you should choose yourself which one from two solution ways provides the best performance in your case.
Showing/hiding of columns is relatively slow, because all rows of the grid, column headers (inclusive the filter toolbar) need be looked through and the inline css style on the corresponding cells be changes (display property should be set to none or the none value should be removed). After that the with and the height of the grid could be changed too. If the grid has frozen columns, then the same should be done in the frozen dives. Additionally the width and the height of frozen dives should be recalculated and the height of every row of the frozen columns should be recalculated too.
Thus one have two alternatives:
- hide/show all columns which you need by calls of
showCol, hideCol, showHideCol and then trigger jqGridResetFrozenHeights event on the grid to force recalculation of all width/height properties of frozen dives
- destroy the frozen columns by call of
destroyFrozenColumns, apply hiding/showing the columns by calling of showCol, hideCol, showHideCol and to recreate frozen columns once more by call of setFrozenColumns.
I recommend you to make some tests to choose, which one from the above two ways provides the best performance in your application.