Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ana Laura on Jan 20, 2009 07:22
open dhtmlx forum
dhtmlxGrid - Change the color of cell content by its value

Hello, I'm using version 1.5

I need to change the color on the cell depending the value it has, but I want to do this when I load the grid, not by double click o something similar.

Thanks,

Answer posted by dhxSupport on Jan 20, 2009 08:43
You can use onCellChanged event

grid.attachEvent("onCellChanged",function(id,ind,value){
     if (value < 0 ) grid.setCellTextStyle(id,ind,"color:red;");
});

The event will be called against any data entered in grid, including data loaded from XML or any other datasource