You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/extensions/get-started/building-simple-field-customizer.md
+30-24Lines changed: 30 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ This article describes how to create your first Field Customizer Extension. You
65
65
code .
66
66
```
67
67
68
-
**Note:** Because the SharePoint client-side solution is HTML/TypeScript based, you can use any code editor that supports client-side development to build your extension.
68
+
> **Note:** Because the SharePoint client-side solution is HTML/TypeScript based, you can use any code editor that supports client-side development to build your extension.
69
69
70
70
Note how the default solution structure looks like the solution structure of client-side web parts. This is the basic SharePoint Framework solution structure, with similar configuration options across all solution types.
71
71
@@ -143,7 +143,7 @@ You cannot currently use the local workbench to test SharePoint Framework Extens
143
143
144
144

145
145
146
-
5. Create a new list named **Orders** and then select **Create**.
146
+
5. Create a new list named **Orders**, and then select **Create**.
147
147
148
148

149
149
@@ -161,34 +161,38 @@ You cannot currently use the local workbench to test SharePoint Framework Extens
161
161
162
162
Because our Field Customizer is still hosted in localhost and is running, we can use specific debug query parameters to execute the code in the newly created list.
163
163
164
-
9. Append the following query string parameters to the URL. Notice that you will need to update the ID to match your own extension identifier available from the **HelloWorldFieldCustomizer.manifest.json** file.
164
+
9. Append the following query string parameters to the URL. Notice that you will need to update the ID to match your own extension identifier available from the **HelloWorldFieldCustomizer.manifest.json** file. For more information, see [More details about the URL query parameters](#more-details-about-the-url-query-parameters).
- **loadSPFX=true** ensures that the SharePoint Framework is loaded on the page. For performance reasons, the framework is not normally loaded unless at least one extension is registered. Because no components are registered yet, we must explicitly load the framework.
173
-
- **debugManifestsFile** specifies that you want to load SPFx components that are locally served. The loader only looks for components in the App Catalog (for your deployed solution) and the SharePoint manifest server (for the system libraries).
174
-
- **fieldCustomizers** indicates which fields in your list should have their rendering controlled by the Field Customizer. The ID parameter specifies the GUID of the extension that should be used to control the rendering of the field. The properties parameter is an optional text string containing a JSON object that will be deserialized into `this.properties` for your extension.
175
-
- **Key**: Use the internal name of the field as the key.
176
-
- **Id**: The GUID of the Field Customizer extension associated with this field.
177
-
- **Properties**: The property values defined in the extension. In this example, `sampleText` is a property defined by the extension.
178
-
179
-
The full URL should look similar to the following, depending on your tenant URL and the ___location of the newly created list:
171
+
The full URL should look similar to the following, depending on your tenant URL and the ___location of the newly created list:
Notice how the Percent values are now presented with an additional prefix string as `Hello!: `, which is provided as a property for the Field Customizer.

188
184
189
-
Notice how the Percent values are now presented with an additional prefix string as 'Hello!: ', which is provided as a property for the Field Customizer.
190
185
191
-

186
+
### More details about the URL query parameters
187
+
188
+
- **loadSPFX=true** ensures that the SharePoint Framework is loaded on the page. For performance reasons, the framework is not normally loaded unless at least one extension is registered. Because no components are registered yet, we must explicitly load the framework.
189
+
- **debugManifestsFile** specifies that you want to load SPFx components that are locally served. The loader only looks for components in the App Catalog (for your deployed solution) and the SharePoint manifest server (for the system libraries).
190
+
- **fieldCustomizers** indicates which fields in your list should have their rendering controlled by the Field Customizer. The ID parameter specifies the GUID of the extension that should be used to control the rendering of the field. The properties parameter is an optional text string containing a JSON object that will be deserialized into `this.properties` for your extension.
191
+
- **Key**: Use the internal name of the field as the key.
192
+
- **Id**: The GUID of the Field Customizer extension associated with this field.
193
+
- **Properties**: The property values defined in the extension. In this example, `sampleText` is a property defined by the extension.
194
+
195
+
<br/>
192
196
193
197
## Enhance the Field Customizer rendering
194
198
Now that we have successfully tested the out-of-the-box starting point of the Field Customizer, let's modify the logic slightly to have a more polished rendering of the field value.
@@ -246,7 +250,7 @@ Now that we have tested our solution properly in debug mode, we can package this
246
250
1. Install the solution package to the site where it should be installed, so that the extension manifest is white listed for execution.
247
251
248
252
2. Associate the Field Customizer to an existing field in the site. You can do this programmatically (CSOM/REST) or by using the feature framework inside of the SharePoint Framework solution package. You'll need to associate the following properties in the `SPField` object at the site or list level.
249
-
- **ClientSiteComponentId** is the identifier (GUID) of the Field Customizer, which has been installed in the App Catalog.
253
+
- **ClientSiteComponentId** is the identifier (GUID) of the Field Customizer, which has been installed in the App Catalog.
250
254
- **ClientSideComponentProperties** is an optional parameter, which can be used to provide properties for the Field Customizer instance.
251
255
252
256
Note that you can control the requirement to add a solution containing your extension to the site by using the `skipFeatureDeployment` setting in **package-solution.json**. Even though you would not require the solution to be installed on the site, you'd need to associate **ClientSideComponentId** to specific objects for the extension to be visible.
@@ -258,7 +262,9 @@ Now that we have tested our solution properly in debug mode, we can package this
258
262
4. Extend the **sharepoint** folder and **assets** subfolder in the root of the solution to see the existing **elements.xml** file.
259
263
260
264

261
-
265
+
266
+
<br/>
267
+
262
268
### Review the elements.xml file
263
269
264
270
Open the **elements.xml** file inside the **sharepoint\assets** folder.
@@ -282,6 +288,8 @@ Note the following XML structure in **elements.xml**. The **ClientSideComponent
282
288
</Elements>
283
289
```
284
290
291
+
<br/>
292
+
285
293
### Ensure that definitions are taken into account within the build pipeline
286
294
287
295
Open **package-solution.json** from the **config** folder. The **package-solution.json** file defines the package metadata as shown in the following code:
@@ -385,6 +393,4 @@ Now you are ready to deploy the solution to a SharePoint site and get the field
385
393
386
394
In this case, we continued to host the JavaScript from the localhost, but you could just as well relocate the assets to any CDN and update the URL to enable the loading of the JavaScript assets outside of the localhost as well.
387
395
388
-
The process for publishing your app is identical among the different extension types. You can use the following publishing steps to update the assets to be hosted from a CDN.
389
-
390
-
* [Host extension from Office 365 CDN](./hosting-extension-from-office365-cdn.md).
396
+
The process for publishing your app is identical among the different extension types. You can use the following publishing steps to update the assets to be hosted from a CDN: [Host extension from Office 365 CDN](./hosting-extension-from-office365-cdn.md).
0 commit comments