Skip to content

Commit 4236158

Browse files
committed
Added images and updated file names.
1 parent 563565c commit 4236158

20 files changed

+19
-19
lines changed

docs/declarative-customization/column-formattiing.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ You can use column formatting to customize how fields in SharePoint lists and li
77

88
For example, a list with the fields Title, Effort, Assigned To, and Status with no customizations applied might look like this:
99

10-
![SharePoint list with four unformatted columns](../images/sp-customFormatting-none.png)
10+
![SharePoint list with four unformatted columns](../images/sp-columnformatting-none.png)
1111

1212
A list with the appearance of the Effort, Assigned To, and Status fields customized via column formatting might look like this:
1313

14-
![SharePoint list with three columns formatted](../images/sp-customFormatting-all.png)
14+
![SharePoint list with three columns formatted](../images/sp-columnformatting-all.png)
1515

1616
## How is column formatting different than the Field Customizer?
1717
Both column formatting and the [SharePoint Framework Field Customizer](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-field-customizer) extension enable you to customize how fields in SharePoint lists are displayed. The Field Customizer is more powerful, because you can use it to write any code you want to control how a field is displayed. Column formatting is more easily and broadly applied. However, it is less flexible, because it does not allow for custom code; it only allows for certain predefined elements and attributes.
@@ -31,7 +31,7 @@ To open the column formatting pane, open the dropdown menu under a column. Under
3131

3232
If no one has used column formatting on the column you selected, the pane will look like the following.
3333

34-
![Format column pane with space to paste or type column formatting JSON and options to preview, save, and cancel](../images/sp-customFormatting-panel.png)
34+
![Format column pane with space to paste or type column formatting JSON and options to preview, save, and cancel](../images/sp-columnformatting-panel.png)
3535

3636
A field with no formatting specified will use the default rendering. To format a column, enter the column formatting JSON in the box.
3737

@@ -72,7 +72,7 @@ You can use column formatting to apply styles, classes, and icons to fields, dep
7272
### Conditional formatting based on a number range (basic)
7373
The following image shows an example of conditional formatting applied to a number range.
7474

75-
![Severity warning of 70 with orange background](../images/sp-customFormatting-conditionalBasic.png)
75+
![Severity warning of 70 with orange background](../images/sp-columnformatting-conditionalbasic.png)
7676

7777
This example customizes a number field to color that field red when its value less than 70. This example adds a style attribute to the parent `<div />` element, specifies a CSS class (`sp-field-severity--warning`) to apply to that item if the value inside the field is less than 70, and specifies no color if the value is outside that range (in which case it will use the default color for values in that list view).
7878
Note: this example uses a binary operation with the less than operator, "<", nested inside the conditional operation indicated by the operator, ":". Another description of the section in the following example is: If @currentField < 70 Then class = sp-field-severity--warning.
@@ -104,7 +104,7 @@ Note: this example uses a binary operation with the less than operator, "<", nes
104104

105105
The following image shows an example of conditional formatting applied to a text or choice field.
106106

107-
![Status field with done colored green, blocked colored red, and in review colored orange](../images/sp-customFormatting-conditionalAdvanced.png)
107+
![Status field with done colored green, blocked colored red, and in review colored orange](../images/sp-columnformatting-conditionaladvanced.png)
108108

109109
You can apply conditional formatting to text or choice fields that might contain a fixed set of values. The following example applies different classes depending on whether the value of the field is Done, In Review, Blocked, or another value. This example applies a CSS class (`sp-field-severity--low, sp-field-severity--good, sp-field-severity--warning, sp-field-severity--blocked`) to the `<div />` based on the field's value. Then, it outputs a `<span />` element with an `IconName` attribute. This attribute applies another CSS class to that `<span />` that shows an [Office UI Fabric](https://dev.office.com/fabric#/) icon inside that element. Finally, another `<span />` element is outputted that contains the value inside the field.
110110

@@ -289,7 +289,7 @@ Because dates are often used to track deadlines and key project timelines, a com
289289

290290
The following image shows a field with conditional date formatting applied.
291291

292-
![Status field with the Overdue text colored red](../images/sp-customFormatting-overdue.png)
292+
![Status field with the Overdue text colored red](../images/sp-columnformatting-overdue.png)
293293

294294
This example colors the current field red when the value inside an item's DueDate is before the current date/time. Unlike some of the previous examples, this example applies formatting to one field by looking at the value inside another field. Note that DueDate is referenced using the [$FieldName] syntax. FieldName is assumed to be the internal name of the field. This example also takes advantage of a special value that can be used in date/time fields - `@now`, which resolves to the current date/time, evaluated when the user loads the list view.
295295

@@ -382,7 +382,7 @@ You can use column formatting to provide hyperlinks that go to other web pages,
382382
### Turn field values into hyperlinks (basic)
383383
This example shows how to turn a text field that contains stock ticker symbols into a hyperlink that targets the Yahoo Finance real-time quotes page for that stock ticker. The example uses a `+` operator that appends the current field value to the static hyperlink <a>http://finance.yahoo.com/quote/</a>. You can extend this pattern to any scenario in which you want users to view contextual information related to an item, or you want to start a business process on the current item, as long as the information or process can be accessed via a hyperlink parameterized with values from the list item.
384384

385-
![Stocks list with ticker symbols turned into hyperlinks](../images/sp-customFormatting-hyperlinks.png)
385+
![Stocks list with ticker symbols turned into hyperlinks](../images/sp-columnformatting-hyperlinks.png)
386386

387387
```JSON
388388
{
@@ -403,7 +403,7 @@ This example shows how to turn a text field that contains stock ticker symbols i
403403
### Add an action button to a field (advanced)
404404
The following image shows action buttons added to a field.
405405

406-
![Assigned To field with mail buttons added to names](../images/sp-customFormatting-actionButton.png)
406+
![Assigned To field with mail buttons added to names](../images/sp-columnformatting-actionButton.png)
407407

408408
You can use column formatting to render quick action links next to fields. The following example, intended for a person field, renders two elements inside the parent `<div />` element:
409409

@@ -448,7 +448,7 @@ Use column formatting to combine conditional and arithmetical operations to achi
448448
### Format a number column as a data bar (advanced)
449449
The following image shows a number column formatted as a data bar.
450450

451-
![Effort list with number list items shown as bars](../images/sp-customFormatting-dataBars.png)
451+
![Effort list with number list items shown as bars](../images/sp-columnformatting-databars.png)
452452

453453
This example applies `background-color` and `border-top` styles to create a data bar visualization of `@currentField`, which is a number field. The bars are sized differently for different values based on the way the `width` attribute is set - it's set to `100%` when the value is greater than 20, and `(@currentField * 5)%` when there value is less than 10. This achieves a width of 5% for the data bar for values of 1, 10% for values of 2, and so on. To fit this example to your number column, you can adjust the boundary condition (`20`) to match the maximum anticipated value inside the field, and the multiplier (`5`) to specify how much the bar should grow depending on the value inside the field.
454454
```JSON
@@ -498,7 +498,7 @@ This example applies `background-color` and `border-top` styles to create a data
498498
### Show trending up/trending down icons (advanced)
499499
The following image shows a list with trending up/trending down icons added.
500500

501-
![List with trending up and trending down icons next to list items](../images/sp-customFormatting-trending.png)
501+
![List with trending up and trending down icons next to list items](../images/sp-columnformatting-trending.png)
502502

503503
This example relies on two number fields, `Before` and `After`, for which the values can be compared. It shows the appropriate trending icon next to the `After` field, depending on that field's value compared to the value in `Before`. `sp-field-trending--up` is used when `After`'s value is higher; `sp-field-trending--down` is used when `After`'s value is lower.
504504

@@ -582,15 +582,15 @@ You can use the following predefined classes for several common scenarios.
582582
| Class name | Screenshot |
583583
| ------------- |:-------------| :-----|
584584
| sp-field-customFormatBackground |Specifies the padding and margins for all classes that use backgrounds. |
585-
| sp-field-severity--good |![Green box with text Done and check mark](../images/sp-customFormatting-severityGood.png) |
586-
| sp-field-severity--low |![White box with text In Progress and arrow](../images/sp-customFormatting-severityLow.png) |
587-
| sp-field-severity--warning | ![Yellow box with text In Review and hazard icon](../images/sp-customFormatting-severityWarning.png) |
588-
| sp-field-severity--severeWarning | ![Orange box with text Has issues and hazard icon](../images/sp-customFormatting-severitySevereWarning.png) |
589-
| sp-field-severity--blocked | ![Red box with text Blocked and X icon](../images/sp-customFormatting-severityBlocked.png) |
590-
| sp-field-dataBars |![Blue bar with number 4](../images/sp-customFormatting-dataBar.png) |
591-
| sp-field-trending--up |![Green arrow with number 500](../images/sp-customFormatting-trendingUp.png) |
592-
| sp-field-trending--down |![Red arrow with number 100](../images/sp-customFormatting-trendingDown.png) |
593-
| sp-field-quickAction |![Name with mail icon](../images/sp-customFormatting-quickAction.png) |
585+
| sp-field-severity--good |![Green box with text Done and check mark](../images/sp-columnformatting-severitygood.png) |
586+
| sp-field-severity--low |![White box with text In Progress and arrow](../images/sp-columnformatting-severitylow.png) |
587+
| sp-field-severity--warning | ![Yellow box with text In Review and hazard icon](../images/sp-columnformatting-severitywarning.png) |
588+
| sp-field-severity--severeWarning | ![Orange box with text Has issues and hazard icon](../images/sp-columnformatting-severityseverewarning.png) |
589+
| sp-field-severity--blocked | ![Red box with text Blocked and X icon](../images/sp-columnformatting-severityblocked.png) |
590+
| sp-field-dataBars |![Blue bar with number 4](../images/sp-columnformatting-databar.png) |
591+
| sp-field-trending--up |![Green arrow with number 500](../images/sp-columnformatting-trendingup.png) |
592+
| sp-field-trending--down |![Red arrow with number 100](../images/sp-columnformatting-trendingdown.png) |
593+
| sp-field-quickAction |![Name with mail icon](../images/sp-columnformatting-quickaction.png) |
594594

595595
## Predefined icons
596596

Loading
7.18 KB
Loading
22.3 KB
Loading
Loading
Loading
515 Bytes
Loading
2.76 KB
Loading
7.72 KB
Loading
1.32 KB
Loading

0 commit comments

Comments
 (0)