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-cmdset-with-dialog-api.md
+23-21Lines changed: 23 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ This article describes how to create your first ListView Command Set Extension.
64
64
code .
65
65
```
66
66
67
-
**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.
67
+
> **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
68
69
69
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.
70
70
@@ -153,47 +153,49 @@ You cannot currently use the local workbench to test SharePoint Framework Extens
153
153
154
154
Because our ListView Command Set is hosted from localhost and is running, we can use specific debug query parameters to execute the code in the list view.
155
155
156
-
3. Append the following query string parameters to the URL. Notice that you will need to update the GUID to match the ID of your ListView Command Set Extension available in the **HelloWorldCommandSet.manifest.json** file:
156
+
3. Append the following query string parameters to the URL. Notice that you will need to update the GUID to match the ID of your ListView Command Set Extension available in the **HelloWorldCommandSet.manifest.json** file. For more information, see [More details about the URL query parameters](#more-details-about-the-url-query-parameters).
157
157
158
158
```
159
159
?loadSpfx=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={"a8047e2f-30d5-40fc-b880-b2890c7c16d6":{"___location":"ClientSideExtension.ListViewCommandSet.CommandBar","properties":{"sampleTextOne":"One item is selected in the list.","sampleTextTwo":"This command is always visible."}}}
160
160
```
161
161
162
-
More detail about the URL query parameters:
162
+
The full URL should look similar to the following, depending on your tenant URL and the ___location of the list.
163
163
164
-
- **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.
165
-
- **debugManifestsFile** specifies that we want to load SPFx components that are being 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).
166
-
- **customActions** simulates a custom action. You can set many properties on this `CustomAction` object that affect the look, feel, and ___location of your button; we’ll cover them all later.
167
-
- **Key**: GUID of the extension.
168
-
- **Location**: Where the commands are displayed. The possible values are:
169
-
- **ClientSideExtension.ListViewCommandSet.ContextMenu:** The context menu of the item(s)
170
-
- **ClientSideExtension.ListViewCommandSet.CommandBar:** The top command set menu in a list or library
171
-
- **ClientSideExtension.ListViewCommandSet:** Both the context menu and the command bar (Corresponds to SPUserCustomAction.Location="CommandUI.Ribbon")
172
-
- **Properties**: An optional JSON object containing properties that are available via the `this.properties` member.
173
-
174
-
The full URL should look similar to the following, depending on your tenant URL and the ___location of the list.
175
-
176
-
```
177
-
contoso.sharepoint.com/Lists/Orders/AllItems.aspx?loadSpfx=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={"a8047e2f-30d5-40fc-b880-b2890c7c16d6":{"___location":"ClientSideExtension.ListViewCommandSet.CommandBar","properties":{"sampleTextOne":"One item is selected in the list.","sampleTextTwo":"This command is always visible."}}}
178
-
```
164
+
```
165
+
contoso.sharepoint.com/Lists/Orders/AllItems.aspx?loadSpfx=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={"a8047e2f-30d5-40fc-b880-b2890c7c16d6":{"___location":"ClientSideExtension.ListViewCommandSet.CommandBar","properties":{"sampleTextOne":"One item is selected in the list.","sampleTextTwo":"This command is always visible."}}}
166
+
```
179
167
180
168
4. Accept the loading of debug manifests by selecting **Load debug scripts** when prompted.
Notice the new **Command Two** button available in the toolbar. If you select that button, you'll see the text provided as property for the `sampleTextTwo` property.
172
+
5. Notice the new **Command Two** button available in the toolbar. Select that button to see the text provided as property for the `sampleTextTwo` property.
185
173
186
174

187
175
188
-
The **Command One** button is not visible based on the code, until one row is selected in the document library. Upload or create a document to the library and confirm that the second button is visible.
176
+
6. The **Command One** button is not visible based on the code, until one row is selected in the document library. Upload or create a document to the library and confirm that the second button is visible.
189
177
190
178

191
179
192
-
5. Select **Command Two** to see how the dialog control works, which is used in the default output from the solution scaffolding when the ListView Command Set is selected as the extension type.
180
+
7. Select **Command Two** to see how the dialog control works, which is used in the default output from the solution scaffolding when the ListView Command Set is selected as the extension type.
193
181
194
182

195
183
196
184
185
+
### More details about the URL query parameters
186
+
187
+
- **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.
188
+
- **debugManifestsFile** specifies that we want to load SPFx components that are being 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).
189
+
- **customActions** simulates a custom action. You can set many properties on this `CustomAction` object that affect the look, feel, and ___location of your button; we’ll cover them all later.
190
+
- **Key**: GUID of the extension.
191
+
- **Location**: Where the commands are displayed. The possible values are:
192
+
- **ClientSideExtension.ListViewCommandSet.ContextMenu:** The context menu of the item(s)
193
+
- **ClientSideExtension.ListViewCommandSet.CommandBar:** The top command set menu in a list or library
194
+
- **ClientSideExtension.ListViewCommandSet:** Both the context menu and the command bar (Corresponds to SPUserCustomAction.Location="CommandUI.Ribbon")
195
+
- **Properties**: An optional JSON object containing properties that are available via the `this.properties` member.
196
+
197
+
<br/>
198
+
197
199
## Enhance the ListView Command Set rendering
198
200
199
201
The default solution takes advantage of a new Dialog API, which can be used to show modal dialogs easily from your code. In the following steps, we'll slightly modify the default experience to demonstrate Dialog API use cases.
0 commit comments