Check documentation for the latest version of dhtmlxSuite enableAlterCss DHTMLX Docs

enableAlterCss

sets css styles for even/odd rows

void enableAlterCss(string cssE,string cssU, [boolean perLevel,boolean levelUnique] );
cssEstringname of css class for even rows
cssUstringname of css class for odd rows
perLevelbooleantrue|false - mark rows not by order, but by level in treegrid (optional, default value: true - treeGrid, false - Grid)
levelUniquebooleantrue|false - creates additional unique css class based on the row level (optional, false by default)

Example

.even{
    background-color:#22FF44;
}
.uneven{
    background-color:#41964e;
}   
 
 
//a minimal parameters' set:
myGrid.enableAlterCss("even","uneven");
//disable even/odd rows in the grid:
myGrid.enableAlterCss("","");
//color rows in treeGrid by order:
myGrid.enableAlterCss("even","uneven",false,false);
//color rows in treeGrid by level,each row level will have a unique class 
//(even_0 - 1st level, uneven_1 - 2nd level, even_2 - 3rd level, etc.)
myGrid.enableAlterCss("even","uneven",true,true);

Back to top