Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tadeu Maia on Jul 26, 2008 07:43
open dhtmlx forum
Color depending on value of cell

hi, I want to switch to color the cell depending on the value of a particular cell
Answer posted by Support on Jul 28, 2008 03:20
You can use onEditCell event to change the color of cell after it was changed
    grid.attachEvent("onEditCell",function(stage,id,ind,value){
       if (stage == 2){
             grid.setCellTextStyle(id,ind,"backround-color:"+(value>0?"green":"red")+";")
        }
       return true;
    });