开发者

How to obtain the colModel name from iCol index?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜