0

I have made some custom command sets that are being displayed in the command bar. I want those commands to be displayed only inside a document set and not anywhere else.

I did follow the official microsoft for building the command set. https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api

1 Answers1

0

I answered this here

@override
  public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void {    
    const compareOneCommand: Command = this.tryGetCommand('COMMAND_1');
    if (compareOneCommand) {
      // This command should be hidden unless exactly one row is selected.
      compareOneCommand.visible = this.context.pageContext.list.title === 'MyList3';      
    }
  }
Lee
  • 5,305
  • 1
  • 6
  • 12
  • The demo is for https://www.itidea.nl/index.php/spfx-associate-listview-command-set-to-a-content-type/ content type. – Lee Apr 01 '19 at 06:31