Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Hide Column in jQgrid but show this Column in Add/Edit panel

I want a form of control I use. But the number of fields that are too high. How can I display the grid, but only some of the fields in the form add/edit popup panel show all fields ???

like image 844
Pouya Avatar asked Feb 02 '12 10:02

Pouya


People also ask

How do I hide a column in Jqgrid?

You can use the following code to hide a table column.. JQuery("tableName"). hideCol("colName");

How do I freeze a column in Jqgrid?

First you will need to setup which columns will be frozen/locked. This is done in colModel setting the property frozen:true.

What is Formatter in Jqgrid?

Formatter supports advanced formatting of the contents of cells in form, in-line and cell editing. Formatter can be used in either of two ways: Predefined and Custom. In this section, we discuss the Predefined Formatter.


2 Answers

Here is how you can do this:

colModel:[
    {
        name:'email',
        label: 'E-mail',
        editable: true,
        hidden: true,
        editrules: {edithidden: true}
    }

The E-mail column will not appear in the grid but it will be present in the edit dialog.

BTW to achieve the opposite (display in the grid but not in the edit dialog):

colModel:[
    {
        name:'email',
        label: 'E-mail',
        editable: false
    }
like image 64
Tomasz Nurkiewicz Avatar answered Oct 06 '22 05:10

Tomasz Nurkiewicz


Use hidden property for your column

example:

<sjg:gridColumn name="a_unid" index="a_unid" title="Ref id"  hidden="true"/>
like image 21
sathya Avatar answered Oct 06 '22 04:10

sathya