Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






Hide a column in jqGrid

UserPost

15:28
04/01/2011


gunjan shah

India

Member

posts 20

Hello Friends,


 I have used jqGrid in my jsp page . I want to hide the column named "Id" , but I can not. I have written my code below :


<script type="text/javascript">
            $(document).ready(function(){
                
                var myData=[
                    {id:"1",denomination:"1000",deletelink:"Delete"},
                    {id:"2",denomination:"2000",deletelink:"Delete"},
                    {id:"3",denomination:"3000",deletelink:"Delete"},
                    {id:"4",denomination:"4000",deletelink:"Delete"},
                    {id:"5",denomination:"5000",deletelink:"Delete"},
                    {id:"6",denomination:"6000",deletelink:"Delete"},
                    {id:"7",denomination:"7000",deletelink:"Delete"},
                    {id:"8",denomination:"8000",deletelink:"Delete"},
                    {id:"9",denomination:"9000",deletelink:"Delete"},
                    {id:"10",denomination:"10000",deletelink:"Delete"},
                    {id:"11",denomination:"11000",deletelink:"Delete"},
                    {id:"12",denomination:"12000",deletelink:"Delete"},
                ];

                jQuery('#listData').jqGrid({
                    datatype:"local",
                    width:330,
                    height:150,
                    colNames:['Denomination Id','Denomination','Delete'],
                    colModel:[
                        {name:'id',index:'id',align:'center',hidedlg:true,sortable:false,editable:false,edittype:"text",editrules:{required:true}},
                        {name:'denomination',index:'denomination',sortable:false,align:'center',editable:true,edittype:"text",editrules:{number:true,required:true}},
                        {name:'deletelink',index:'deletelink',sortable:false,editable:false,formatter:'showlink',align:'center',editrules:{required: true},formatoptions:{baseLinkUrl:'deleteDeno.htm',addParam:'&action=delete'}}
                    ],
                    pager: '#pager',
                    viewrecords:true,
                    emptyrecords: "Nothing to display",
                    multiselect:false

                }).navGrid('#pager',
                {edit: false, add: false, del:false, search: false, refresh: false },
                {}, // Default for edit
                {},//Default for add
                {}//Default for delete
            );

                for(var index=0;index<myData.length;index++)
                {
                    jQuery("#listData").jqGrid('addRowData',index+1,myData[index]);
                }

                 

            });

        </script>

I have used hidedlg:true , but its not working. Can u help me ?

Thanx In Advance,

Gunjan Shah.


15:33
04/01/2011


OlegK

Germany

Member

posts 1210

Hi Gunjan,

you should use hidden:true instead of hidedlg:true, which has another meaning.

Best regards
Oleg

18:32
04/01/2011


coachz

Member

posts 6

add   .hideCol('id') to the end like this:    http://stackoverflow.com/quest…..-in-jqgrid


05:58
05/01/2011


gunjan shah

India

Member

posts 20

Hi Oleg ,


Its working by hide:true .

Thanx a lot….Laugh


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

215


Currently Online:

60 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 10272

Posts: 30351

Membership:

There are 11037 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1210

markw65 – 179

kobruleht – 144

phicarre – 132

YamilBracho – 124

Renso – 118

Administrators: admin (60 Posts)

Moderators: tony (7375 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information