SPFx - ListView Extension - Get WebPartContext

%3CLINGO-SUB%20id%3D%22lingo-sub-3071081%22%20slang%3D%22en-US%22%3ESPFx%20-%20ListView%20Extension%20-%20Get%20WebPartContext%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3071081%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20currently%20working%20on%20a%20SPFx%20List%20View%20Command%20Set%20extension%20using%20React.%20This%20is%20OnPrem%20(SP%202019)%20so%20using%20SPFx%201.4.1.%3C%2FP%3E%3CP%3EHave%20created%20a%20Service%20class%20for%20my%20common%20queries%20to%20SharePoint.%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20one%20of%20the%20call%20I%20want%20to%20pass%20%3CEM%3EWebPartContext%3C%2FEM%3E%20from%20%3CEM%3EListViewCommandSet.ts%3C%2FEM%3E%20file.%20When%20accessed%20from%20%3CEM%3Ethis.context%3C%2FEM%3E%20I'm%20getting%20List%20scope%20which%20is%20fine%20but%20now%20how%20can%20I%20access%20%3CEM%3EWebPartContext%3C%2FEM%3E%20either%20in%20%3CEM%3EListViewCommandSet.ts%26nbsp%3B%3C%2FEM%3Efile%20so%20I%20can%20pass%20it%20to%20Service%20or%20access%20it%20in%20Service%20%3CEM%3ETS%3C%2FEM%3E%20file%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ESanjay%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3071081%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESPFx%20React%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi All,

 

I'm currently working on a SPFx List View Command Set extension using React. This is OnPrem (SP 2019) so using SPFx 1.4.1.

Have created a Service class for my common queries to SharePoint. 

In one of the call I want to pass WebPartContext from ListViewCommandSet.ts file. When accessed from this.context I'm getting List scope which is fine but now how can I access WebPartContext either in ListViewCommandSet.ts file so I can pass it to Service or access it in Service TS file?

 

Any help would be appreciated.

 

Thanks,

Sanjay

 

0 Replies