Forum Discussion
jellybeancooper
Jan 16, 2024Brass Contributor
How do you change the color of the second grouped item header in a list view
I have a list that is grouped by Building and then by Room.
I can use json to change the color of the headers as follows:
"groupProps": {
"hideFooter":true,
"headerFormatter": {
"elmType": "div",
"style": {
"background-color": "blue"
},
This makes Building header and Room header both blue. I would like to make the Room header a lighter colour of blue. Is this possible?
You can use a condition on the field name for this.
"groupProps": { "hideFooter": true, "headerFormatter": { "elmType": "div", "attributes": { "class": "sp-row-card" }, "style": { "background-color": "=if(@group.columnDisplayName == 'Building','blue','lightblue')", "color": "white" } } }
1 Reply
- ThomasAkalowskiCopper Contributor
You can use a condition on the field name for this.
"groupProps": { "hideFooter": true, "headerFormatter": { "elmType": "div", "attributes": { "class": "sp-row-card" }, "style": { "background-color": "=if(@group.columnDisplayName == 'Building','blue','lightblue')", "color": "white" } } }