Setting color doesn't work

I wanted to change the row color based on a cell condition.

But I can’t even set the row or cell color let alone do anything else.

TIA,

David

Code:

window.onload = function() {

mygrid = new dhtmlXGridObject('grid_here');                     
mygrid.setImagePath("/dhtmlx_pro/dhtmlxGrid/codebase/imgs/");   
                                                                
mygrid.setHeader("Date Set,Date Due,Priority,Title,Notes,DIV"); 
                                                                
mygrid.setInitWidths("80,150,60,200,200,50");                   
mygrid.enableAutoWidth(true);                                   
mygrid.setColAlign("left,left,left,left,left,left");            
mygrid.setColTypes("ro,ed,coro,ed,ed,ed");                      
mygrid.setColSorting("date,date,int,na,na,str");//set sorting   
mygrid.setSkin("dhx_skyblue");                                  
                                                                
mygrid.forEachRow(function(id){                                 
                                                                
    //if (mygrid.cellById(id,3).getValue()=="Urgent")     

    // ??? WHY DOESN'T THIS WORK ???
    mygrid.setCellTextStyle(id,1,"background-color: green");  // IGNORES?    
    //mygrid.setRowColor(id, "yellow"); // IGNORES WHEN UNCOMMENTED?                        
                                                                
    //else if (mygrid.cellById(id,INDEX).getValue()=="Y") mygrid

ound-color: yellow");

});

mygrid.init();                                                  
mygrid.load("/reminder/data");                                  
                                                                
var dp = new dataProcessor("/reminder/data");                   
dp.action_param = "dhx_editor_status";                          

/*
mygrid.load("/dhtmlx/data_test.php");
var mydp = new dataProcessor("/dhtmlx/data_test.php");
*/
dp.init(mygrid);
}

Please, try to call the forEachRow function after the data is loaded to your grid:

[code]mygrid.init();
mygrid.load("/reminder/data",function(){
mygrid.forEachRow(function(id){

//if (mygrid.cellById(id,3).getValue()==“Urgent”)

// ??? WHY DOESN’T THIS WORK ???
mygrid.setCellTextStyle(id,1,“background-color: green”); // IGNORES?
//mygrid.setRowColor(id, “yellow”); // IGNORES WHEN UNCOMMENTED?

//else if (mygrid.cellById(id,INDEX).getValue()==“Y”) mygrid
ound-color: yellow");
}); [/code]

});