Questions tagged [spfx]

General technical questions about the SharePoint Framework client-side development model.

Filter by
Sorted by
Tagged with
1
vote
1answer
9 views

using SP.UI.Modaldialog.showDialog(options); in spfx listview extension is executing but no dialog is visible

Hi I'm trying to open sharepoint dialog using spfx extension in which using typing able to get the SP.UI.ModalDialog Object in ts file of the extension. And the code # SP.UI.ModalDialog....
0
votes
1answer
16 views

Fetch multiple images from SharePoint library and display images in SPFX webpart

SharePoint Library -- Multiple image and HexID field I am able to display one image by giving full URL of images but i have to filter the images based on HexID, But I am not sure how to apply filter, ...
0
votes
0answers
25 views

SP fast deploy error “File not found”

I've been getting this error but the bundle file is already present. Can anyone help me out Fast deploying to SP App C:\Users\xanderCage\Desktop\xanderCage.Apps.SharePoint-Dev1.0_react\OnboardingApp\...
0
votes
1answer
19 views

Use SharePoint Theme colors in SASS exported variables

I want to apply the color palette of the selected SharePoint theme to a SPFx webpart by setting a set of variables I export from the SPFx webpart's .scss. I want to define the colors as exported ...
0
votes
2answers
39 views

SPFX - How to suppress TypeScript errors in the terminal so the app can compile?

I have tried using // @ts-ignore which removes the error from my IDE, but in the terminal the error persits so the app does not compile. Any idea how to get around this? https://www.npmjs.com/...
1
vote
1answer
32 views

Hide Site page title in modern view

I'm working on a SharePoint online modern view where I'm using Site pages to add the content on the portal. I want to hide the title of the site page at the top like we use to do in on-premise ...
0
votes
0answers
23 views

Get list items from a site collection in different Geo location using REST API in SPFx

I'm trying to get list items from a different Geo-location within the same tenant in an SPFx solution. I've tried pnp-js, spHttpClient, etc and end up getting 403. Is there a way to achieve this?
0
votes
0answers
18 views

Sharepoint SPFX react/typescript mobile layout

So I created a Sharepoint SPFx React Typescript app which works perfect. Using this guide here I design a mobile version of the web part app: https://goshakkk.name/different-mobile-desktop-tablet-...
0
votes
0answers
9 views

How OverrideViewXml parameter works with ViewXml in RenderListDataAsStream in rest API?

I am working on to get data from SharePoint list using the RenderListDataAsStream endpoint. What I am doing is first getting all the views defined for the list and showing them in a dropdown on UI and ...
0
votes
2answers
18 views

getting the file template used for a specific file in a document library

I am trying to not have to create a different content type for a document library. Instead I was thinking if given the files in a document library I can find out which file template was used for that ...
1
vote
0answers
23 views

Show the Total Count of the column value generated using SPFx Field Customizer

I have developed a Field Customizer Extension. This renders the item count based on the logic for each cell in the Document Library. Now, I want to show the total of the count at the bottom of the ...
0
votes
0answers
16 views

CAML filter, RowLimit options not working with Spfx solution

This question may look duplicate but actually i didn't find any proper solution to this. Issue: Threshold error when I am getting items from list more than 5K even after applied filters with indexed ...
1
vote
1answer
22 views

In SharePoint Framework Extension (Application Customizer), are there any other placeholders that can be used aside from the header and footer?

We are trying to add a drop-down control in the command bar of a page or beside the share button on a SharePoint Online site. May we know if there is a specific placeholder we can use to achieve this?...
0
votes
0answers
9 views

How do you mount a spfx component for testing?

const element: React.ReactElement<MyCustomProps> = React.createElement( MyCustomContainer, { var1: variable1 ... var100: variable100 }); I ...
0
votes
1answer
11 views

How would you unit test a WebPart that extends BaseClientSideWebPart?

I want to unit test that webpart, but I am not sure how to go about it. I have around 30 properties and 50 private variables. How do I mock them? I use PnP to fetch values for the private values, but ...
1
vote
1answer
21 views

Update person field (multiple selection) using JavaScript without PnP

I am trying to create an SPFx web part using SharePoint 2016. When adding PnP to SharePoint 2016, it's giving me errors and not working like when I add it to a SharePoint online SPFx web part. How can ...
0
votes
1answer
15 views

yo @microsoft/sharepoint Cannot Build webpart project for Sharepoint 2019 On Premesis

I was editing webparts for 2019 SP. I then found some errors on sHTTPclient Argument of type 'import("node_modules/@microsoft/sp-http/dist/index-internal").SPHttpClientConfiguration' is not ...
0
votes
0answers
16 views

How to print the selected value of Dropdown

I would like to know if there is a way to print the selected value of a Dropdown menu that is inside the Property Pane in SPFX. Like, in my case, how to make it print with a console.log "Ascending" ...
2
votes
2answers
27 views

Making MsGraphClient request synchronous (await)

Im trying to use a get call through the MsGraphClient in a synchronous manner, but it doesn't seem to be working for me: public getDirectReports = async (manager): Promise<any[]> => { ...
1
vote
1answer
24 views

Custom Web Part Uploading Incorrectly

I am trying to upload my custom web part to my sharepoint online site. The upload is successful, but when adding the web part to a site it is not the expected content of the web part. It seems to be ...
1
vote
0answers
17 views

How to use a custom component inside the onCustomRender() method for the PropertyFieldCollectionData component?

I am using onCustomRender and I am rendering a custom component I have made, and I was wondering why the properties didn't save on render. I think it was because I didn't use onUpdate(). Is that ...
1
vote
0answers
15 views

SyntaxError: Unexpected token export when unit trying to unit test Microsoft API library function calls in SPFx

I have these tests, the first one passes, but I can't get my mounting to work properly: import 'jest'; import * as React from 'react'; import { configure, mount, ReactWrapper } from 'enzyme'; import *...
0
votes
1answer
22 views

SPFx Loading indicator not working when solution is deployed on SharePoint Online

I'm fair new to SPFx and I was tasked to consolidate some webparts there were previously in different solutions into one spfx solution including all of them, I started with 4 webparts, in all of them ...
1
vote
0answers
11 views

Is there a foolproof way to set up Jest unit testing on any SPFx project?

I tried to get it working, but I was repeatedly getting errors about the Typescript syntax coming from Microsoft's own internal code, and I couldn't do anything to get it fixed even after looking at ...
2
votes
1answer
29 views

Open Manage Access and Permissions Panels via JavaScript in Modern SharePoint Online

Is it possible to open the "Manage Access" Panel for a List Item or the advanced "Permissions" Panel to share the site in modern SharePoint Online (Modern Page/List etc.) with JS? I know it can be ...
1
vote
1answer
26 views

Object notation react map groupby

I am trying to group an object by division. I am not able to figure out how to map them. So the object notation is something like below > Object.keys(this.state.ListItems).map(function(item,key) &...
1
vote
1answer
22 views

Application Customiser doesn't work on SharePoint homepage 2019 on-prem

I have a very basic application customiser that adds a custom css file to the page, hiding certain elements like the "Get the mobile app" button. The app is installed in the mysite host app catalog, ...
0
votes
1answer
30 views

Get column value, not ID, from a look up column

thank you for reading; my problem is: I want to retrieve the values of the column "GroupWithPriority". That column is a Look Up from other list. When I try to get the value, all I get is "...
1
vote
1answer
22 views

React List Keys row edit PNPJS dropdown & People Picker

I am trying to enable row edit for a particular array of People Picker and Dropdown controls. Below is what I have so far, <table cellSpacing="1"> <div className={styles....
1
vote
2answers
150 views

What is the best practice for getting JS and CSS files into a SharePoint Modern Page? [closed]

I'm looking for the best way to include JS and CSS files into a SharePoint Modern page, which can be done once across a number of pages. At the moment I've got the Script Editor web part to include my ...
0
votes
0answers
121 views

Jest encountered an unexpected token while using Typescript, React and SPFx

describe('Enzyme basics', () => { let reactComponent: ReactWrapper<ICrudProps>; beforeEach(() => { reactComponent = mount(React.createElement( Crud, { ...
2
votes
2answers
48 views

React Props in main component, change to state on change dropdown

I have a main component that is calling a list. I am passing this item to one of the components prop which is the value of a dropdown. For me to be able to setstate, I assigned the prop to state ...
7
votes
2answers
105 views

Modern UI Vs Classic UI Vs Power App, IS Classic UI still the most flexible way to customize SharePoint list forms?

Most of the time when I add a new custom list inside SharePoint online, its New & Edit forms will need to be customized, the customization falls into these main categories: Certain fields to be ...
0
votes
2answers
29 views

What does super.onInit() do?

VideoChatWebPart extends BaseClientSideWebPart protected async onInit(): Promise<void> { ... return super.onInit(); } We have a class that contains the method onInit(). Now, I saw ...
0
votes
0answers
16 views

Can we batch API calls if they're wrapped in custom functions?

I have this method and I am wondering if we can batch the API calls. I am not sure if it's possible, because I am using a wrapper function that contains the pnp API functions. Is there a way to do ...
1
vote
2answers
42 views

How do you use componentDidMount and componentDidUpdate in a BaseWebPart class?

Someone told me that he was using componentDidMount and componentDidUpdate in his BaseWebPart class, but looking at the documentation below I realized it shouldn't be possible since it's not a React ...
2
votes
2answers
29 views

how gulp serve related to sharepoint spfx webpart

I have created the sample spfx solution and uploaded it into the app catalog and i have added it to the site page. if I am changing in the local code and if I run the gulp serve the actual changes are ...
3
votes
1answer
55 views

How can I obtain the Teams Context in Sharepoint?

I'm developing a WebPart that will be used with Sharepoint and Teams. My question is easy, I need to retrieve the the microsoftTeams context to get the username. How can I do it?. So far, I have ...
0
votes
1answer
22 views

Uncaught (in promise) TypeError: sort is not a function react spfx

var currStatus = ''; var job = [...this.state.data]; return <div> { job.length ? <div> { Object.keys(job).forEach(jobTree) => ...
2
votes
2answers
53 views

cdnBasePath in Modern Web Parts

I am new to both SPFx web-parts and the O365 CDN. My question stems from my newness in both areas. I have managed to enable the CDN in my tenant and define a couple of Origins. My understanding is ...
0
votes
1answer
37 views

How to set a default Modern footer and/or set footer links Programmatically

I have a client with currently hundreds of Modern Communication sites in SharePoint Online, and will potentially be creating thousands in the near future. They have a fairly simple Footer with only a ...
0
votes
0answers
25 views

SharePoint Framework REACT: Get User Photo using Graph API not returning image

Iam trying to get Users Photo by using Microsoft Graph API. By testing GET request in Graph Explorer i get the result, i can se the image. It means REST query works using Graph explorer. GRAPH ...
3
votes
1answer
66 views

SPFx Loading Issue

I have created the SPFx Project with extension and Web parts. It is working well if I run gulp serve. If I refresh the browser page it is not loading. It throws an error. If I copy the same URL ...
0
votes
1answer
33 views

SPFx development - npm audit vulnerabilities

The company I work for needs custom web parts in modern SharePoint. I was humming along following the excellent (Microsoft's sponsored) tutorials on SPFx development. I got my web part working on my ...
0
votes
1answer
17 views

how to read all the properties of all the files in a Document Set Using @pnp spfx

how to read all the properties of all the files in a Document Set Using @pnp spfx React JS ?
2
votes
0answers
17 views

Spfx: Change spfx Webpart environment from sharepoint online to sharepoint on prem

I have a modern web part built for sharepoint Online. I want to convert this web part to be compatible with sharepoint on-prem 2019. I have searched and found out that I would need to use spfx ...
1
vote
1answer
26 views

How to add the new command bar button at the end of the other menu using spfx ? like after flow

How to add the new command bar button at the end of the other menu using SPFx? like after flow. My new button(eviewer) is getting added after export to excel. I want to be added after end of flow. ...
1
vote
1answer
25 views

How to get items from SP list using query and @pnp/sp and Filtering

I have a getItems function that accepts a filter, but I need to know how to pass in two different filters so that I can retrieve items filtered by both Age and First Name. Here is the definition of ...
5
votes
1answer
90 views

Rich Text Editor Control for React with IE 11 Support

I want to implement an SPFX web part with React using which user can provide their view on the given questions. Users should be able to add images or links or use formatting for the text to provide ...
0
votes
1answer
35 views

Unexpected error when adding webpart to modern page

I've been having trouble adding a custom web part to my modern page. I was able to add the web part to a legacy site, but I don't have the same luck with modern sites. In the legacy site it works ...

1
2 3 4 5
24