I am using JQGrid in my app.
Here I want to change the color if JqGrid row based on value in side the column.
I am able to change the color of column but I can not change the background color of row.
Here is the code that I am using to change the color of a row...
loadComplete: function (data) {
//RETRIEVE COLUMN INDEX : ISPRINTED
var isPrintColIndex = getGridColumnIndex(jQuery("#list10_d"), 'isPrinted');
//CHANGE COLOR OF PRINTED ARTICLES
//NOTE : JSON FORMATs ARE DIFFERENT SO ...HERE WE ARE ADDING CONDITION
if (data != null && data.rows != null) {
for (var index = 0; index < data.rows.length; index++) {
if (typeof (data.rows[index].id) === 'undefined') {
//LOAD BY JQGRID API ITSELF
if (data.rows[index].isPrinted == 'NO') {
if (data.rows[index].isPrinted == 'NO') {
jQuery("#list10_d").jqGrid(
'setCell', data.rows[index]._id_, "articleid",
"", {
'background-color': 'red'
});
}
}
} else {
///FOR FIRST LOAD : LOAD BY JSON CALL
if (data.rows[index].cell[isPrintColIndex] == 'NO') {
jQuery("#list10_d").jqGrid(
'setCell', data.rows[index].id, "articleid", "", { 'background-color': 'red' });
}
}
}
}
}
Can anyone suggest me changes in above code So I can change the background color of the row??