Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Randell Benavidez on Aug 01, 2009 09:46
open dhtmlx forum
TreeGrid row alternating color

Hi! Does the TreeGrid API provide a way to have alternating colors for the main rows for the light skin? Thanks!
Answer posted by dhxSupport on Aug 03, 2009 03:54
You can use enableAlterCss(cssE, cssU, perLevel, levelUnique) method. Parameters here are:
cssE - name of css class for even rows
cssU - name of css class for odd rows
perLevel - true/false - mark rows not by order, but by level in treegrid (optional, default value: true - treeGrid, false - Grid)
levelUnique - true/false - creates additional unique css class based on row level (optional, false by default)
For example:
//color rows in treeGrid by order:
  treeGrid.enableAlterCss("even","uneven",false,false);
 //color rows in treeGrid by level,every row level will have unique class (even_0 - 1st level, uneven_1 - 2nd level, even_2 - 3rd level, etc.)
  treeGrid.enableAlterCss("even","uneven",true,true);