If you are implementing a custom formatter and want to get the cell value in relation to getCell or getRowData you also need to execute the unformat function.
It's not clear what you mean by "I need the actual object, not the value of the cell." It is also unclear which datatype
you are using, whether you use the loadonce: true
parameter or not, and if you download data from the server, in what format the data will be sent to the server.
If you use datatype: 'local'
or use loadonce: true
, the internal data
and _index
will be populated. To get the raw data from the rowid
grid, you can use
var rowData = this.p.data[this.p._index[rowid]]
or
var grid = $(this), localdata = grid.jqGrid('getGridParam', 'data'), indexes = grid.jqGrid('getGridParam', '_index'), rowData = localdata[indexes[rowid]];
If you do not use datatype: 'local'
or use loadonce: true
and load data from the server, you can save the object representing the data from the server response in a variable (in the object). The loadComplete
event loadComplete
has one data
parameter, which is the source data sent from the server. Thus, you can save the data that you need in the object (on the map that receives the yut object from rowid) and use it inside the onSelectRow
event onSelectRow
.
source share