[grouping in slickgrid] need to apply different background color to group header row. There is no specific css class for it...I have tried everything please suggest some solution
Asked
Active
Viewed 395 times
2 Answers
0
It appears that the html for the group header is:
<div class="ui-widget-content slick-row odd slick-group slick-group-level-0" style="top:75px">
<div class="slick-cell l0 r6 cell-selection">
<span class="slick-group-toggle expanded" style="margin-left:0px"></span>
<span class="slick-group-title" level="0">Title: Task 1
<span style="color:green">(1 items)</span>
</span>
</div>
</div>
So adding some css to the 'slick-group' class should do the trick

Ben McIntyre
- 1,972
- 17
- 28
0
Add random color to header row -
let row = document.getElementsByClassName("slick-row") as HTMLCollectionOf<HTMLElement>;
for (var i = 0; i < row.length; i++) {
row[i].style.background = this.rowColor();
}
rowColor() {
var r = ('0' + (Math.random() * 255 | 0).toString(16)).slice(-2),
g = ('0' + (Math.random() * 255 | 0).toString(16)).slice(-2),
b = ('0' + (Math.random() * 255 | 0).toString(16)).slice(-2);
return '#' + r + g + b;
}

Pinaki
- 792
- 8
- 17