1

I tried show hide column menu described in

How to change column name in column chooser pop up in jqgrid?

If there are more columns than fits to crenn in context menu, remaining columns are not shown.

How to allow to toggle all columns: how to make column menu multi-column and add scrollbar or other idea ?

Update

Customers table contains more columns if fits to menu. Remaining columns cannot selected.

Community
  • 1
  • 1
Andrus
  • 26,339
  • 60
  • 204
  • 378
  • Sorry, but I don't understand what is " fits to crenn". Where the scrollbar should be added? Is it the same problem like in [the issue](https://github.com/free-jqgrid/jqGrid/issues/39) or it's another problem? – Oleg Apr 05 '15 at 15:42
  • It is another problem. I updated question and provided image. End of context menu is marked with red. – Andrus Apr 05 '15 at 16:08

1 Answers1

1

I posted updated version of jquery.jqgrid.showhidecolumnmenu.js to the github. It should solve the described problems.

Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thank you. It is working. Grid state is saved in localstorage using code from http://stackoverflow.com/questions/8422878/persisting-jqgrid-column-preferences Sometimes selected columns using ColumnMenu are saved and sometimes not. How to save selected columns always ? It there some callback which can used for saving or other way ? Or is state persistence already included in free jqgrid or its plugins? – Andrus Apr 06 '15 at 16:09
  • Selected rows are saved also using code from http://stackoverflow.com/questions/8545953/how-to-persist-current-row-in-jqgrid – Andrus Apr 06 '15 at 16:16
  • @You are welcome! I think that the problem with saving of `hidden` state of columns is *another problem*. `showHideColumnMenu` just uses `showCol`/`hideCol`. So if one would use `onShowHideCol` callback or `jqGridShowHideCol` event then one could detect correctly the changes of the `hidden` state of columns. – Oleg Apr 06 '15 at 16:21
  • I used `$.extend(true, $.jgrid.defaults, { onShowHideCol: saveWindowState})` Is this OK ? – Andrus Apr 06 '15 at 16:40
  • @Andrus: It looks good, but everything need be tested. I personally prefer don't use callbacks for common settings, because you can don't detect the situation, that somebody else (or you in some grid) will do use the same callback `onShowHideCol`. Such using sill overwrite `onShowHideCol: saveWindowState` and the grid will don't save the state on hiding/showing the rows. I would prefer to use `jqGridShowHideCol` event instead. – Oleg Apr 06 '15 at 16:45