Posted 11 June 2018, 10:45 pm EST
Hi Zam,
You may use a combination of CSS along with formatItem event to get the desired result.
/* CSS */
.wj-colheaders .wj-header{
--bg-color:"#eaeaea";
background-color: var(--bg-color);
}
/* formatItem event handler */
flex.formatItem.addHandler((s:wjcGrid.FlexGrid,e:wjcGrid.FormatItemEventArgs )=>{
if(e.panel.cellType==wjcGrid.CellType.ColumnHeader){
if(e.row==1){
e.cell.style.setProperty("--bg-color","cyan");
}
else if(e.row==0){
switch(e.panel.columns[e.col].binding){
case "perf.ytd":
case "perf.m1":
case "perf.m6":
case "perf.m12": e.cell.style.setProperty("--bg-color","pink");break;
case "alloc.stock":
case "alloc.bond":
case "alloc.cash":
case "alloc.other":e.cell.style.setProperty("--bg-color","yellow");break;
default: e.cell.style.setProperty("--bg-color","#eaeaea");break;
}
}
}
Please refer to the following example which implements the same:-
https://stackblitz.com/edit/angular-7yhc73?file=app%2Fapp.component.ts
~Manish