开发者

How to obtain the colModel name from iCol index?

开发者 https://www.devze.com 2023-01-25 02:00 出处:网络
I have a jqGrid event handler that receives the 开发者_如何学运维iCol as a parameter. I need to know how to obtain the name specified in colModel for that given iCol.

I have a jqGrid event handler that receives the 开发者_如何学运维iCol as a parameter. I need to know how to obtain the name specified in colModel for that given iCol.

For example given the following jqGrid event handler: onSelectCell that receives rowid, celname, value, iRow, iCol

How can I get the colModel name associated with the iCol index?

Thanks in advance


Let us you have grid with id="list". Then you can use either

var cm = $("#list")[0].p.colModel;

or documented

var cm = $("#list").jqGrid('getGridParam','colModel');

to get a reference to the array colModel. So

cm[iCol].name

will get us the name of the corresponding column.

0

精彩评论

暂无评论...
验证码 换一张
取 消