Skip to content

Commit 2c34ad3

Browse files
ldemarisVesaJuvonen
authored andcommitted
Update view-formatting.md (SharePoint#2317)
1 parent d984191 commit 2c34ad3

File tree

1 file changed

+4
-89
lines changed

1 file changed

+4
-89
lines changed

docs/declarative-customization/view-formatting.md

Lines changed: 4 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,7 @@ This example applies the class `sp-field-severity--severeWarning` to a list view
3636
```JSON
3737
{
3838
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
39-
"additionalRowClass": {
40-
"operator": "?",
41-
"operands": [
42-
{
43-
"operator": "<=",
44-
"operands": [
45-
"[$DueDate]",
46-
"@now"
47-
]
48-
},
49-
"sp-field-severity--severeWarning",
50-
""
51-
]
52-
}
39+
"additionalRowClass": "=if([$DueDate] <= @now, 'sp-field-severity--severeWarning', ''"
5340
}
5441
```
5542

@@ -60,79 +47,7 @@ This example was adopted from a column formatting example, [Conditional formatti
6047
```JSON
6148
{
6249
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
63-
"additionalRowClass": {
64-
"operator": "?",
65-
"operands": [
66-
{
67-
"operator": "==",
68-
"operands": [
69-
{
70-
"operator": "toString()",
71-
"operands": [
72-
"[$Status]"
73-
]
74-
},
75-
"Done"
76-
]
77-
},
78-
"sp-field-severity--good",
79-
{
80-
"operator": "?",
81-
"operands": [
82-
{
83-
"operator": "==",
84-
"operands": [
85-
{
86-
"operator": "toString()",
87-
"operands": [
88-
"[$Status]"
89-
]
90-
},
91-
"In progress"
92-
]
93-
},
94-
"sp-field-severity--low",
95-
{
96-
"operator": "?",
97-
"operands": [
98-
{
99-
"operator": "==",
100-
"operands": [
101-
{
102-
"operator": "toString()",
103-
"operands": [
104-
"[$Status]"
105-
]
106-
},
107-
"In review"
108-
]
109-
},
110-
"sp-field-severity--warning",
111-
{
112-
"operator": "?",
113-
"operands": [
114-
{
115-
"operator": "==",
116-
"operands": [
117-
{
118-
"operator": "toString()",
119-
"operands": [
120-
"[$Status]"
121-
]
122-
},
123-
"Blocked"
124-
]
125-
},
126-
"sp-field-severity--severeWarning",
127-
"sp-field-severity--blocked"
128-
]
129-
}
130-
]
131-
}
132-
]
133-
}
134-
]
135-
}
50+
"additionalRowClass": "=if([$Status] == 'Done', 'sp-field-severity--good', if([$Status] == 'In progress', 'sp-field-severity--low' ,if([$Status] == 'In review','sp-field-severity--warning', if([$Status] == 'Blocked','sp-field-severity--blocked', ''))"
13651
}
13752
```
13853

@@ -151,7 +66,7 @@ This example uses the `rowFormatter` element, which totally overrides the render
15166
{
15267
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
15368
"hideSelection": "true",
154-
"hideListHeader": "true",
69+
"hideColumnHeader": "true",
15570
"rowFormatter": {
15671
"elmType": "div",
15772
"attributes": {
@@ -256,6 +171,6 @@ Optional element. Specifies whether the ability to select rows in the view is d
256171

257172
`hideSelection` only takes effect when there's a `rowFormatter` element specified. If no `rowFormatter` is specified, then `hideSelection` is ignored.
258173

259-
### hideListHeader
174+
### hideColumnHeader
260175

261176
Optional element. Specifies whether the column headers in the view are hidden or not. *false* is the default behavior inside a list view. *true* means that the view will not display column headers.

0 commit comments

Comments
 (0)