Skip to content

Commit d06974c

Browse files
gunna025VesaJuvonen
authored andcommitted
improves cmdset elements.xml explanation (SharePoint#1931)
1 parent d9d8762 commit d06974c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,34 @@ Notice that we use a specific ___location value of `ClientSideExtension.ListViewCom
286286
Location="ClientSideExtension.ListViewCommandSet.CommandBar"
287287
ClientSideComponentId="5fc73e12-8085-4a4b-8743-f6d02ffe1240"
288288
ClientSideComponentProperties="{"sampleTextOne":"One item is selected in the list.", "sampleTextTwo":"This command is always visible."}">
289+
</CustomAction>
290+
291+
</Elements>
292+
```
289293

294+
> [!NOTE]
295+
> While running from localhost the custom action will work on both lists and document libraries, but will not once deployed unless the `elements.xml` is updated. `RegistrationId=100` will only associate the custom action with lists and **NOT** document libraries. In order to associate the custom action with document libraries, the `RegistrationId` must be set to **101**. If you would like the action to work on both lists and document libraries, another `CustomAction` must be added to the `elements.xml` file
296+
297+
```xml
298+
<?xml version="1.0" encoding="utf-8"?>
299+
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
300+
301+
<CustomAction
302+
Title="SPFxListViewCommandSet"
303+
RegistrationId="100"
304+
RegistrationType="List"
305+
Location="ClientSideExtension.ListViewCommandSet.CommandBar"
306+
ClientSideComponentId="5fc73e12-8085-4a4b-8743-f6d02ffe1240"
307+
ClientSideComponentProperties="{&quot;sampleTextOne&quot;:&quot;One item is selected in the list.&quot;, &quot;sampleTextTwo&quot;:&quot;This command is always visible.&quot;}">
308+
</CustomAction>
309+
310+
<CustomAction
311+
Title="SPFxListViewCommandSet"
312+
RegistrationId="101"
313+
RegistrationType="List"
314+
Location="ClientSideExtension.ListViewCommandSet.CommandBar"
315+
ClientSideComponentId="5fc73e12-8085-4a4b-8743-f6d02ffe1240"
316+
ClientSideComponentProperties="{&quot;sampleTextOne&quot;:&quot;One item is selected in the list.&quot;, &quot;sampleTextTwo&quot;:&quot;This command is always visible.&quot;}">
290317
</CustomAction>
291318
292319
</Elements>

0 commit comments

Comments
 (0)