Hide a column while viewing selected row from JQGrid pager button.

702 views Asked by At

I have one column in JQGrid.

{ name: 'Action', index: 'Action', width: 70, sortable: false, formatter: 'actions', formatoptions: { keys: true, editformbutton: false, editbutton: true, delbutton: false } }

I want to hide the above column while viewing a selected row from JQGrid pager button. Is there any way to achieve this?

1

There are 1 answers

1
Oleg On BEST ANSWER

You need add viewable: false property to all columns which you don't want to show in View dialog.

You added only sortable: false as property to Action column. I would recommend you to include some other properties to the column where you use formatter: "actions":

frozen: true,
fixed: true,
resizable: false,
sortable: false,
search: false,
editable: false,
viewable: false

I define typically the column template (see the answer for example) for formatter: "actions". I include all the above properties (and some other settings like default width, formatoptions: { keys: true } and other) which I use typically. In the way the code of the grid will be smaller and better readable.