Skip to content

Commit 568f57f

Browse files
ldemarisVesaJuvonen
authored andcommitted
Update view-formatting.md (SharePoint#2262)
Updating samples with the right schema link
1 parent aebc5c3 commit 568f57f

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

docs/declarative-customization/view-formatting.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ This example applies the class `sp-field-severity--severeWarning` to a list view
3535

3636
```JSON
3737
{
38+
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
3839
"additionalRowClass": {
3940
"operator": "?",
4041
"operands": [
@@ -58,6 +59,7 @@ This example was adopted from a column formatting example, [Conditional formatti
5859

5960
```JSON
6061
{
62+
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
6163
"additionalRowClass": {
6264
"operator": "?",
6365
"operands": [
@@ -147,16 +149,13 @@ This example uses the `rowFormatter` element, which totally overrides the render
147149

148150
```JSON
149151
{
152+
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
150153
"hideSelection": "true",
151154
"hideListHeader": "true",
152155
"rowFormatter": {
153156
"elmType": "div",
154-
"style": {
155-
"padding": "12px",
156-
"overflow": "hidden",
157-
"border-radius": "2px",
158-
"box-shadow": "0 1.6px 3.6px 0 #dddddd, 0 0.3px 0.9px 0 #e3e3e3",
159-
"margin-bottom": "12px"
157+
"attributes": {
158+
"class": "sp-row-card"
160159
},
161160
"children": [
162161
{
@@ -167,36 +166,28 @@ This example uses the `rowFormatter` element, which totally overrides the render
167166
"children": [
168167
{
169168
"elmType": "div",
170-
"style": {
171-
"font-size": "16px",
172-
"font-weight": "600",
173-
"padding-bottom": "8px"
169+
"attributes": {
170+
"class": "sp-row-title"
174171
},
175172
"txtContent": "[$Title]"
176173
},
177174
{
178175
"elmType": "div",
179-
"txtContent": "[$Feedback]",
180-
"style": {
181-
"padding-bottom": "4px"
182-
}
176+
"attributes": {
177+
"class": "sp-row-listPadding"
178+
},
179+
"txtContent": "[$Feedback]"
183180
},
184181
{
185182
"elmType": "button",
186183
"customRowAction": {
187184
"action": "defaultClick"
188185
},
189186
"txtContent": "Give feedback",
187+
"attributes": {
188+
"class": "sp-row-button"
189+
},
190190
"style": {
191-
"cursor": "pointer",
192-
"font-weight": "600",
193-
"background-color": "#f4f4f4",
194-
"border": "1px solid transparent",
195-
"margin-top": "4px",
196-
"padding": "0 16 0 16px",
197-
"height": "32px",
198-
"border-radius": "2px",
199-
"box-shadow": "0 0 0 0 #ffffff",
200191
"display": {
201192
"operator": "?",
202193
"operands": [
@@ -232,7 +223,7 @@ Creating custom view formatting JSON from scratch is simple if you understand th
232223

233224
```JSON
234225
{
235-
"$schema": "http://listformatting.sharepointpnp.com/viewFormattingSchema.json"
226+
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json"
236227
}
237228
```
238229

0 commit comments

Comments
 (0)