1
votes

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

1

1 Answers

2
votes

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.