简体   繁体   中英

How to pass column value to another column in Jqgrid

I have the following jqgrid code, I am creating a link and then trying to pass the bankId values to each row. ie link1 link2

How can I pass the bankId values in fdic column in jqgrid

{ name: 'bankId',label: 'bankId', align:'left', width: 10,hidden:true },
{ name: 'fdicNumber', label: 'fdicNumber',width: 70, key: true,
            formatter: "showlink",
                formatoptions: {
                    baseLinkUrl: testUrl,
                    idName: "",
                    addParam: function (options,rowObject) {
                      //  return "clientid="+options.rowid+" ;
                        return "clientid="+options.bankId+" ;
                    }
                }

            },

If you use free jqGrid then the usage of addParam as function is allowed. The callback function has one parameter with properties cellValue , rowid , rowData and options (with formatoptions ). You can fix your code of addParam as following:

addParam: function (options) {
    return "clientid=" + options.rowData.bankId;
}

or

addParam: function (options) {
    return "clientid=" + encodeURIComponent(options.rowData.bankId);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM