Questions tagged [spfx-webparts]

Technical questions about building and using web parts based on the SharePoint Framework client-side development model.

Filter by
Sorted by
Tagged with
5
votes
2answers
2k views

Include JavaScript file so it load automatically in SharePoint Framework

I am beginner and trying to include JS file in my SharePoint Framework Webpart. I learned how to call different functions of the JS file. I know you can include the file using const myScript = ...
5
votes
1answer
1k views

SPFx web part not showing from the catalog

Followed the video from SharePoint Framework development with SharePoint 2016 Feature Pack 2 but could not add the web part to the site because it did not show up. I made sure I have only SPFx 1.0....
5
votes
0answers
217 views

Office ui fabric react not working with SharePoint hosted app!

I have created SharePoint hosted app using VS2015, and in that i have used Office ui fabric react components. I have installed it and other packages of React and React-dom using npm, App is ...
4
votes
2answers
2k views

SharePoint Framework: How to detect if running on modern or classic page?

We see some differences in our SPFx web part behavior depending on which page type it is placed on (modern vs. classic). Classic pages behave somewhat differently. I'd like to detect which page type ...
4
votes
1answer
17k views

Anyone can explain the .ts file and .tsx file use and difference in SPFx react webpart?

In SPFx No JavaScript Framework webpart contain "webpart.ts" file and write code in it. But in React SPFx webpart, there are 2 file : 1) webpart.ts file 2) webpart.tsx file in component folder. ...
4
votes
2answers
420 views

SPFx: How to test for the 3 SharePoint flavors: Classic, New Experience and SPFx

When injecting code in the New Experiences (only possible with Browser Extension) I use: var isClassicSharePoint = typeof SP !== 'undefined'; So my generic library knows when to use SP.SOD and ...
4
votes
2answers
2k views

Calling external API in SharePoint framework

I am trying to call the dummy API from SPFX, but I am getting an error, Failed to fetch, this.context.httpClient .get("http://dummy.restapiexample.com/api/v1/employees", HttpClient.configurations....
4
votes
1answer
2k views

Can't get context for pnp get api calls in spfx solution

I'm having trouble getting the correct site context for @pnp/sp. It works fine in workbench but not when I deploy to a site and add to a modern page. My api calls are being made to /_api/sitepages and ...
4
votes
2answers
756 views

SPFx: Can you use WebPartContext in components different than the main one?

I am trying to call Microsoft Graph from a component, different than the main one. As a first step I am declaring a variable for the MSGraphClient's serviceKey like this: const graphClient: ...
4
votes
1answer
1k views

How to open property pane in a SPFx webpart without going in edit mode?

Is there a way to open the property pane without going into edit mode?
4
votes
2answers
2k views

SharePoint Framework: How to let modern web parts interact with each other?

How can web parts know of and interact with each other within the SharePoint Framework? Here's an example. Let's say we need: a search box web part search result web part a filter web part All ...
4
votes
1answer
1k views

Deploy SPFx webpart in SharePoint 2013

I want to deploy my webpart developed with SPFx in my site on SharePoint 2013 farm. I followed this tutorials : http://jenkinsblogs.com/2016/10/04/deploy-spfx-client-side-web-part-to-a-sharepoint-...
4
votes
1answer
721 views

SPFx Client Web Part - Store In Properties or List

I'm trying to get to grips with the SPFx client web part. I've read examples of people creating "items" which are stored in the web part properties. This looks great. No need to provision a list, ...
4
votes
4answers
351 views

SharePoint Framework web parts - do you need a developer tenant?

I want to test my SharePoint Framework web part in Office 365, in SharePoint Online. Therefore I upload the .sppkg file to the App Catalog. Unfortunately SharePoint says my app package is invalid: ...
4
votes
1answer
503 views

Using bootstrap in SPFx RC.0 webpart

I searched and used below code snippet: import * as React from 'react'; import styles from './Announcements.module.scss'; import { HttpClient, SPHttpClient, SPHttpClientConfigurations } from '@...
4
votes
1answer
295 views

Missing workaround in SPFx JQuery WebPart

In the SPFx JQuery tutorial there is this instruction :- For drop 1, there is a workaround needed when loading css files (later on in this tutorial we will show you how). For now, you need to include ...
4
votes
1answer
89 views

Should I rewrite all the existing jquery ajax webparts in Typescript or is it better to inject existing jquery in SPFX?

We are moving from SharePoint 2013 to SharePoint Online. We are thinking of migrating existing webparts in 2013, which have jquery - ajax, to SPFX client webparts. Do we have to rewrite all the code ...
4
votes
1answer
54 views

Updating a webpart - Which gulp commands do I need to be running?

I have a couple webparts locally hosted for my SPO environment. I'm using a Team Site Library to host the "temp" files and the .sppkg file is hosted through the App catalog. When I want to make an ...
4
votes
4answers
922 views

How to catch navigation event in SPFx webpart?

Is it possible to catch navigation event inside Sharepoint Framework web part? I know this is possible in application customizer using context.placeholderProvider.changedEvent, but I cannot find ...
4
votes
1answer
492 views

Get all the user info using Microsoft Graph

How can I get all the user info, from a SPFX WebPart, using Microsoft Graph? I need to call the API 'https://graph.microsoft.com/beta/me/' to get the user info from a SPFX WebPart. I'm using SPFX ...
4
votes
1answer
2k views

SPFx - REST POST Forbidden in Chrome

Problem I'm trying to create/update records in a list using SPFx. It's working as expected in IE, but I'm getting a 403 - FORBIDDEN in Chrome. Request Digest I am fetching my request digest value ...
4
votes
2answers
1k views

Facing issue in binding Kendo UI grid with SharePoint list

I am facing the issue in binding Kendo UI grid with Sharepoint List. I am getting following error, Uncaught TypeError: $(...).kendoGrid is not a function I have added scripts in the following order,...
4
votes
2answers
2k views

How to force render of property panel?

How can I force the SharePoint Framework to re-render the property panel of my Client Side Web Part? In detail I would like to execute the getPropertyPaneConfiguration() method once again when the ...
4
votes
1answer
919 views

SPFx Web Parts on Classic Pages

I have discovered that some SPFx client web parts don't work the same on classic pages as they do on modern pages. I'm currently working with the SPFx Fantastic 40 WebParts. If you try to use the ...
4
votes
1answer
1k views

SPFX error: failed to load component dependency "@microsoft/sp-webpart-base'

Anyone else getting the above error? Two webparts that worked fine yesterday today are failing with: [SPWebPartErrorCode.ScriptLoadError]:: Unable to load web part WebPart.DelmeWebPart.25d255cb-...
4
votes
1answer
4k views

Adding onClick event to a React Web Part

I want to add a simple onclick function, but having trouble doing it. I have looked online, and have tried multiple ways - such as binding it - this.update.bind(this)} within the html string, etc ...
4
votes
3answers
2k views

Deploying both testing and production versions of an SPFx Webpart

I am trying to figure out how to deploy two versions of an SPFx Webpart to the App Catalogue. We need one for production and one for development. What I have tried so far: Modifying the ID in the *....
4
votes
1answer
2k views

How to run SpFx WebPart in SharePoint Online without running Gulp server in background?

I am new to SpFx and I am playing with SpFx. I am trying the example given here. I am able to follow the steps and I am able to add the WebPart to my SharePoint Page. But after adding, I am facing ...
4
votes
1answer
964 views

SharePoint Framework: Loading icon in property pane

I wanted to show loading icon on the drop down present in property pane, till it does not get the data. I am unable to find what needs to be passed to in this.context.statusRenderer....
4
votes
1answer
517 views

What is SPFx and why do we need this? [closed]

I know this is a generic question but I think there are many people out there who are novice in SPFx. I decided to learn this by following This MSDN. Can someone help me to understand npm & ...
4
votes
1answer
596 views

jquery not loaded with SPF

I have this on my config.json { "entries": [ { "entry": "./lib/webparts/pnpcrudsample/PnpcrudsampleWebPart.js", "manifest": "./src/webparts/pnpcrudsample/PnpcrudsampleWebPart....
4
votes
2answers
574 views

Add an SPFx WebPart from an SPFx Extension on a modern site

Within our product we have created an SPFx extension to show a navigation component on the top of our modern pages. Additional to this navigation component we want to show a button which opens an ...
4
votes
1answer
422 views

How can I deploy a SharePoint Framework webpart with a Microsoft Graph API query as an add-in?

I have a set of graph queries that return the email addresses for my Office 365 Group members who are also the members of my connected SharePoint Team Site. https://graph.microsoft.com/v1.0/groups?$...
4
votes
2answers
3k views

SPFX OnChange Event

I am pretty new to the framework. I am trying to change the viewmodel based on the change of the property pane dropdown. I am trying to access the onchange event however that doesnt see to exist out ...
4
votes
1answer
657 views

SPFX Webpart Refreshing on ajax call

What it does I have a simple webpart that pulls in train information to display how many minutes are left and displays the data in the UI. There is a refresh link to refresh the data in the UI. When ...
4
votes
2answers
3k views

spfx webpart Canvas size on Modern Page

I've created an spfx webpart using the react-office-ui-fabric DetailsList. It works fine, but the details list is quite wide. On a modern page the framework is rendeing my webpart in a div that is set ...
4
votes
1answer
110 views

► Will Microsofts CDN increase perfomance for linked HTML files?

Content I pull in from a Document Library This is just f.. slow.. Same site pulls in content from our own HTTPS server Questions Will using Microsofts CDN solution par our own HTTPS server speed? ...
4
votes
1answer
760 views

How do I get Terms from termstore using SharePoint Framework?

I want to fetch terms from termstore, in my SharePoint Framework app. I have tried this microsoft sample: https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/knockout-taxonomy I ...
4
votes
1answer
613 views

Is it possible to have “Cancel” button with “Apply” button for Non reactive Property Pane in New SharePoint Framework

whether it is possible to have "Cancel" button with "Apply" button for Non reactive Property Pane in New SharePoint Framework. i Have followed link https://github.com/SharePoint/sp-dev-docs/blob/...
4
votes
1answer
1k views

Multi language support for Client Side webpart with New SharePoint Development Framework

I have created a sample Hello world webpart using the Examples provided at Office site Webpart has a Property called "Description" in Property Pane which displayed in English Language. I would like ...
4
votes
2answers
445 views

Remove spfx webpart

I've uploaded and deployed some spfx webparts through my App Catalog site. Now these webparts are not useful anymore so I've deleted them from the App Catalog. Then I've checked my sites and ...
4
votes
1answer
851 views

SPFX and react-router

I'm having trouble getting react-router working on my SharePoint Web Part with React and TypeScript. I have tried react-router as a standalone webapp and it works fine. Just can't get it working on ...
4
votes
1answer
689 views

Print Files through SPFx/JS?

I would like to build a button which would send a batch of files to the printer when clicked (It can prompt the user. Doesn't need to go to the printer without approval). The files would exist in a ...
4
votes
0answers
72 views

Is it possible to include fields in a sharepoint list directly from elements.xml file?

I am trying to provision a SharePoint 2013 tasks list from a spfx app using the feature framework. I am able to create an out of the box tasks list with the following list definition in my elements....
4
votes
1answer
511 views

SPFx Custom Property Pane

I had created a SPFx web part. The web part contains a Property Pane Custom Field, which returns a string. Now, when I hit apply button on property pane, my custom property gets the data and render it ...
4
votes
2answers
2k views

Asynchrounously load lookup column values in an SPFX/PNP-JS-CORE editform

I'm working on a spfx app to be used as a SharePoint list form. The app will be used to edit ha a LOT of lookup columns. the lookup columns are rendered as dropdowns in the react component. I am ...
4
votes
0answers
927 views

SPFx Custom Property Pane save property save

When building a SharePoint Framework web part - How to Save Custom Property Pane value? I have created a multiselect field for Property Pane, but not able to retain the values when refresh the page. ...
4
votes
1answer
1k views

Using ADAL with SharePoint Framework

I've setup a web part with SharePoint framework that requires access to the Microsoft Graph for displaying the recently used files. I've followed the instruction here: https://github.com/SharePoint/...
4
votes
1answer
444 views

Moving from CEWP to SPFx - import fabric components

Been struggling with this for the past few days. I am quite new to Sharepoint development. Got my head around CEWP and was using office-ui-fabric-js components with code samples from here. I am now ...
3
votes
1answer
1k views

What is difference between SharePoint Framework (SPFx) Extensions and SharePoint Framework (SPFx) Web PART

I have started working on SharePoint Online. Where I have to use SPFX. What is the Difference between SharePoint Framework (SPFx) Web Part and SharePoint Framework (SPFx) Extensions

1
2
3 4 5
19