JSON Formatting Weird Glitch

Copper Contributor

I've used JSON to remove the column name in views previously, but I'm encountering a weird issue this time. When using the following JSON, the entire header disappears if the view is set to be collapsed by default. If I change the list to be expanded by default, when I collapse the list, the header names still appear without the column name as intended. What's stranger is that when I remove the grouping by clicking the Group by button, then add the same grouping back by clicking the Group by button, the header names appear without the column name which is the intent.

 

This appears to be a bug, but I wanted to confirm if this was now normal behavior. The column I'm grouping by is a Choice type column.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "groupProps": {
    "headerFormatter": {
      "elmType": "div",
      "style": {
        "padding-left": "12px",
        "font-size": "16px",
        "font-weight": "400",
        "cursor": "pointer",
        "outline": "0px",
        "white-space": "nowrap",
        "text-overflow": "ellipsis"
      },
      "customRowAction": {
        "action": "defaultClick"
      },
      "children": [
        {
          "elmType": "div",
          "children": [
            {
              "elmType": "span",
              "style": {
                "padding": "5px 5px 5px 5px"
              },
              "txtContent": "@group.fieldData.displayValue"
            }
          ]
        },
        {
          "elmType": "div",
          "children": [
            {
              "elmType": "div",
              "style": {
                "display": "flex",
                "flex-direction": "row",
                "justify-content": "center"
              },
              "children": [
                {
                  "elmType": "div",
                  "txtContent": "=' (' + @group.count + ')'"
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

 

0 Replies