0

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?

Anand
  • 823
  • 1
  • 10
  • 19
  • You should describe more clear what you need. You wrote about "viewing", but you used editing featues. You set `editformbutton: false`, so one will start *inline editing* inside of the grid. You wrote about "hiding" of "the above column". Which column you mean (the `'Action'` column)? Where hiding? If you mean [View](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing#viewgridrow) feature then you probably mean hiding the column information in the View dialog? In any way you should describe more clear what you need to implement. – Oleg Feb 12 '15 at 13:39
  • @Oleg, I have a JQGrid having some columns along with **Action** column. I use this column for inline editing the grid. But I don't want to show this column to user when they view a selected row using NavGrid pager **view** button. – Anand Feb 13 '15 at 11:06

1 Answers1

1

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.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798