Extend SharePoint with Command Sets
The ListView Command Sets can be used to create new actions to SharePoint command surfaces. A Command Set can run client-side code to implement custom actions. A Command Set can be made available on the SharePoint list’s or library’s command bar (Figure 19.17), context menu, or both.
Figure 19.17 - Command bar
Creating a new ListView Command Set project starts with yo @microsoft/sharepoint
. The Type of the client-side component is Extension,
and the type of the client-side extension is ListView
Command Set
.
The example is an archive function, which moves a list item to a folder called Archive
. The command is only available when a list item is selected and is visible on the command bar and the context menu.
Once the project is completely created, let’s open the manifest.json
file and change the items object to include just one command, like in Figure 19.18.
Figure...