I am using JQGrid in my application.
Here I want to change the color if the JqGrid row is based on the value in the column.
I can change the color of the column, but I can not change the background color of the row.
Here is the code that I use to change the color of a string ...
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 a change in the above code? So can I change the background color of the string?
source share