SharePoint Framework Extension for a list

%3CLINGO-SUB%20id%3D%22lingo-sub-165768%22%20slang%3D%22en-US%22%3ESharePoint%20Framework%20Extension%20for%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-165768%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Friends%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20created%20a%20Framework%20extension%20using%20Command%20Set%20and%20deployed%20successfully.%20It%20is%20applied%20to%20all%20generic%20list%20as%20I%20have%20mentioned%20%22100%22%20in%20the%20registrationId.%20I%20don't%20want%20to%20this%20command%20appear%20in%20all%20the%20list%20but%20want%20to%20be%20specific%20in%20specific%20site%20alone.%20What%20is%20the%20technique%20to%20do%20that.%20please%20help.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-165904%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Framework%20Extension%20for%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-165904%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20you%20should%20check%20for%20your%20desired%20site%20and%20list%20inside%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%40override%20%3CBR%20%2F%3Epublic%20onListViewUpdated(event%3A%20IListViewCommandSetListViewUpdatedParameters)%3A%20void%20%7B%0Alet%20desiredSiteList%3A%20boolean%20%3D%20false%3B%20%20%0Aconst%20compareOneCommand%3A%20Command%20%3D%20this.tryGetCommand('COMMAND_1')%3B%0A%20%20%20%20if%20(compareOneCommand)%20%7B%0A%20%20%20%20%20%20%2F%2F%20Check%20for%20site%20title%2Furl%20and%20list%20here%20and%20update%20desiredSiteList%0A%20%20%20%20%20%20compareOneCommand.visible%20%3D%20desiredSiteList%3B%0A%20%20%20%20%7D%0A%20%20%7D%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
New Contributor

Dear Friends,

 

I have created a Framework extension using Command Set and deployed successfully. It is applied to all generic list as I have mentioned "100" in the registrationId. I don't want to this command appear in all the list but want to be specific in specific site alone. What is the technique to do that. please help. 

 

Thanks in advance!

1 Reply

I think you should check for your desired site and list inside 

@override 
public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void { let desiredSiteList: boolean = false; const compareOneCommand: Command = this.tryGetCommand('COMMAND_1'); if (compareOneCommand) { // Check for site title/url and list here and update desiredSiteList compareOneCommand.visible = desiredSiteList; } }