According to wiki getRowData
doesn't return the actual data from the grid.
Returns an array with data of the requested id = rowid
. The returned
array is of type name:value
, where the name is a name from colModel
and the value from the associated column in that row. It returns an
empty array if the rowid
can not be found.
- Do not use this method when you are editing the row or cell. This will return the cell content and not the actuall value of the input
element.
- The performance of this method becomes an issue. Do not use
this method in the body of “for” and “when”. (When calling this
method, it will calculates the row datas one time.)
If the rowid
is
not set the method return all the data from the grid in array
Once you used a custom formatter
option to format a cell content, you need an option to unformat the data.
The question is: What to do if we use a custom formatter
function and
want to to have the original value back if we use editing or methods
getRowData
and getCell
?
The answer is: You can use your own custom unformatter
function to do
that. This function can be used in colModel
.
At this point you might check if the sjg:gridColumn
could be set an attribute to define unformat
function. Unfortunately, you can't do it according to TLD.
However, you can modify the grid after it's loaded.
$(document).ready(function(){
$("#gridtable").jqGrid('setColProp', 'accountNo',{
unformat: unformatFunc
}).trigger("reloadGrid");
});