0

I'm loading my model and data on separate calls and looking to find a way to show some columns, yet hide others, until users choose to use the "choose column" dialog.

For example, I'd like to show id, url, ocr columns by default. Then, if a user decides they want to see other columns, they can open the "choose column" dialog and select what they wish to show. So I'm wondering how I can set the columns to "display" or "hide" but be available in the choose column select dialog.

Any ideas?

rbruhn
  • 185
  • 1
  • 12
  • see the answer here: http://stackoverflow.com/questions/9687201/jqgrid-column-chooser-modal-overlay/9688942#9688942 and the demo: http://www.ok-soft-gmbh.com/jqGrid/SimpleLocalGridWithColumnChooser5__.htm – JGV Oct 07 '15 at 17:56
  • @Vimalan - Ok... I saw that post but still don't see how to make the columns specifically show or hide on load. I would think it would need to be a column parameter when loading the model. – rbruhn Oct 08 '15 at 21:37
  • @rbruhn: Sorry, but your scenario is not full clear. If you use `datatype: "local"` and you need to hide some columns based on the server response then you can use `hideCol` and `showCol` inside of `beforeProcessing`. [Another old answer](http://stackoverflow.com/a/19427444/315935) shows how to changes some other column properties dynamically. – Oleg Oct 09 '15 at 14:35
  • @Oleg - Sorry for not being clearer. My data type is JSON. I load the model and data dynamically with two separate calls to the server. I want a default of 3 columns to show, the rest of the the columns not to show. When a user selects the column chooser, they can add the columns they want to see. From what you linked me to, it appears I set a variable in my json response for the model, loop through it, and set which columns are shown and hidden. So looks like the answer I need. Thanks. – rbruhn Oct 10 '15 at 15:28

0 Answers0