Adding background color to a cell
Hi,
I have a criteria where I need to check data from columns of two rows in jqgrid and set the color to a column where the data is different from previous row.
-
var ids = jq("#xxxx").jqGrid('getDataIDs');
-
var dataFromTheRow = jq("#xxxx").jqGrid ('getRowData', id);
-
var cm = jq("#xxxx").jqGrid("getGridParam", "colModel");
-
for(var i=0;i < ids.length;i++){
-
if(dataFromTheRow[i]['aaa'] === dataFromTheRow[i+1]['aaa']){
-
for(var j=0; j<cm.length;j++){
-
if((dataFromTheRow[i][cm[j].name] !== dataFromTheRow[i+1][cm[j].name]) ){
-
jq("#xxxx").jqGrid('setCell',ids[i], cm[j].name,'',{color: 'white', background: '#e62233'});
-
}}}}
I tried setting the color as mentioned above but unable to get it.
Thanks,
Chiranjeevi.