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": ...
- Jan 16, 2024
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" } } }
ThomasAkalowski
Jan 16, 2024Tin 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"
}
}
}