Hello Abu,
following your documentation I created a column like this:
$col = array();
$col[“title”] = “Map”;
$col[“name”] = “map”;
$col[“editable”] = true;
$col[“formatter”] = “function(cellval,options,rowdata){if (cellval == ‘default’){return ‘<a target=\”_blank\” href=\”map.php?gpx=’ + rowdata.ID + ‘\”>’ + ‘map_link</a>’;} else {return ‘<a target=\”_blank\” href=\”‘ + cellval + ‘\”>’ + cellval + ‘</a>’;}}”;
$col[“unformat”] = “function(cellval,options,cell){var rowdata = jQuery(‘#list1’).getRowData(options.rowId);return rowdata[‘ID’];}”;
$cols[] = $col;
The formatter part works properly, the problem is with the col[“unformat”]: when I try to edit a record the browser freezes and after a few seconds a popup comes out (“A web page is slowing down your browser. what would you like to do”).
To investigate I replaced return rowdata[‘ID’] with alert (rowdata[‘ID’]). In this way it comes out a javascript popup with the correct ID value, but when I close the popup, the same popup reopens countless times…it is clear that there is a kind of infinite loop.
Thanks
Hi, I’ve regenerated this issue and it does not seems to work with unformat + getRowData function.
An alternate is to use: getCell, e.g. following will read gender column cell data.
$col[“unformat”] = “function(cellval,options,cell){ var r = jQuery(‘#list1’).jqGrid(‘getCell’, options.rowId, ‘gender’); return r;}”;