Adding background color to a cell

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. 

CODE:
  1. var ids = jq("#xxxx").jqGrid('getDataIDs');
  2. var dataFromTheRow = jq("#xxxx").jqGrid ('getRowData', id);
  3. var cm = jq("#xxxx").jqGrid("getGridParam", "colModel"); 
  4. for(var i=0;i < ids.length;i++){ 
  5. if(dataFromTheRow[i]['aaa'] === dataFromTheRow[i+1]['aaa']){
  6. for(var j=0; j<cm.length;j++){
  7. if((dataFromTheRow[i][cm[j].name] !== dataFromTheRow[i+1][cm[j].name]) ){
  8. jq("#xxxx").jqGrid('setCell',ids[i], cm[j].name,'',{color: 'white', background: '#e62233'});
  9. }}}}

I tried setting the color as mentioned above but unable to get it. 

Thanks,
Chiranjeevi.