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
Add value of column in the link parameters in jqGrid
05/01/2011
07:12
Avatar
gunjan shah
India
Member
Members
Forum Posts: 20
Member Since:
23/12/2010
sp_UserOfflineSmall Offline

Hello Frineds,

 I have created a jqGrid, in which there is a hyperlink named delete . In that link I want to pass the value of the first colunm. By default jqGrid passes the value of the row id.

 jQuery('#listData').jqGrid({
                    datatype:"local",
                    width:330,
                    height:150,
                    colNames:['Denomination Id','Denomination','Delete'],
                    colModel:[
                        {name:'id',index:'id',align:'center',hidden: true,sortable:false,editable:false,edittype:"text",editrules:{required:true,edithidden: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
            );

In the above example, in the addParam option I want to pass the value of the column named "Denomination Id".

How can I do it ?

Thanx in advance...

05/01/2011
09:49
Avatar
izumeroot
Russia
Member
Members
Forum Posts: 17
Member Since:
18/11/2010
sp_UserOfflineSmall Offline

I think you need use custon button instead delete button.

http://www.trirand.com/jqgridw.....om_buttons

In button's event handler you need use

var rowId = $("#grid-selector").getGridParam("selrow");

and then use  getRowData() grid's method.

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

Hi  Izemuroot,

     

         In my case, I have to use hyperlink instead of custom buttons.By the way,I have solved the problem...

I have changed the values of rowId to denominationId...

  var myData=[
                    {id:"1",denomination:"1000",deletelink:"Delete"},
                    {id:"3",denomination:"2000",deletelink:"Delete"},
                    {id:"4",denomination:"3000",deletelink:"Delete"},
                    {id:"2",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"},
                ];

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

Its working fine now....

Thanx...

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
41 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