Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Hide a column in jqGrid
04/01/2011
15:28
Avatar
gunjan shah
India
Member
Members
Forum Posts: 20
Member Since:
23/12/2010
sp_UserOfflineSmall Offline

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.

04/01/2011
15:33
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Gunjan,

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

Best regards
Oleg

04/01/2011
18:32
Avatar
coachz
Member
Members
Forum Posts: 11
Member Since:
09/04/2009
sp_UserOfflineSmall Offline

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

05/01/2011
05:58
Avatar
gunjan shah
India
Member
Members
Forum Posts: 20
Member Since:
23/12/2010
sp_UserOfflineSmall Offline

Hi Oleg ,

Its working by hide:true .

Thanx a lot....Laugh

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information