I am using jqGrid to display some data. I want to change the color of the text when the data of some columns matches some condition. In order to achieve this, I do the following thing:
loadComplete: function () {
if (rowData['col1'] === "true") {
$('#list').jqGrid('setRowData', rowIds[i], false, { 'color': 'red', 'font- style': 'italic' });
... }
I works for the first page. But I have several pages of the data and when I do either paging or filtering I loose this functionality: the color is black again. I tried to use the other events I found: onPaging, gridComplete and they don't fire at all. I also tried to use the formatter for each column e.g.:
{
name: 'col1',
index: 'col1',
width: '50',
formatter: function (cellvalue, options, rowObject) {
if (rowData['col5'] === "true") {
return "<i>"+cellvalue+"</i>";
...}
But this does not work because when I am in col1 I can not check the value of col5 Please advise.