My SPFX contains extension that adds two commands in Document List:
Elements.xml:
<CustomAction
Title="My Commands"
RegistrationId="101"
RegistrationType="List"
Location="ClientSideExtension.ListViewCommandSet"
ClientSideComponentId="887c888e-abd4-4552-ad51-7ff1d526e3ba">
</CustomAction>
MyCommandsSet.manifest.json
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx/command-set-extension-manifest.schema.json",
"id": "4d7c888e-abd4-4552-ad51-7ff1d526e3ba",
"alias": "MyCommandsSet",
"componentType": "Extension",
"extensionType": "ListViewCommandSet",
"version": "*",
"manifestVersion": 2,
"requiresCustomScript": false,
"items": {
"COMMAND_1": {
"title": { "default": "My Command 1" },
"type": "command"
},
"COMMAND_2": {
"title": { "default": "My Command 2" },
"type": "command"
}
}
}
These two commands are placed in both Command Bar and Context Menu. But it's not that I want. How can I add one command like submenu with these two commands in it? So I want to have one command (e.g. "My Commands") that will work as menu and show two sub-commands: "My Command 1" and "My Command 2".