Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Pradeep on Mar 20, 2009 06:20
open dhtmlx forum
how to get the original style back to row/col once the style is changed explicitly using setCellTextStyle function

Hello,

i need to check whether the value in a particular column in a grid is zero and highlight that col in red color. Once i give some valid number the col color should reset to original as it was before. For that I have done using onEditCell event function like bellow.

But the problem is..

1) On mouse over of row, selected row style is applying only for rest of the non edited cells..
2) On mouseover of style is not apppering for edited cell.

if(grid.cells(rowidx, COL_ID_QTY).getValue()=='0')
{
grid.setCellTextStyle(rowidx,COL_ID_QTY,"background-color:#b63e06;");
}
else
{
backgroundColor = "#ffffff;";
if(grid.getRowIndex(rowidx)*1%2) backgroundColor = "#edeae0;"; // Checkes for row color from alternate row colors
grid.setCellTextStyle(rowidx,colidx,"background-color:"+backgroundColor); // Sets back to original color.

grid.selectRow(grid.getRowIndex(rowidx),false,false,true); // to retain the selected the row style.
}

FYI.. we are using profesional version of Grid.
Could some one give solution for this. Its really urgent.

Thanks in advance,
Pradeep
Answer posted by dhxSupport on Mar 20, 2009 07:01
This happens because of background-color for the certain cell set with hepl of setCellTextStyle method has higher priority then background-color for the selected row. Unfortunately such behaviour cannot be changed.