Hot answers tagged

27 votes

SharePoint development past and "future": how to keep calm?

My observations (answers at bottom): If this is too long then just read the headings Developer => Accept change If you want to stay calm and not have your world changed all the time, then maybe a ...
Per Jakobsen's user avatar
  • 32.4k
18 votes
Accepted

How to retrieve pageContext in SPFx?

this.context.pageContext is available on render() method within top level class that extends BaseClientSideWebPart. Simply pass this.context as a props of to HelloWorld.tsx to reuse it. Sample (...
Jonathan's user avatar
  • 373
17 votes

SharePoint development past and "future": how to keep calm?

So, I'll wade into this discussion. Apologies for the wall of text. Some background - I was a developer in CMS 2001/2002 before we joined the SharePoint group in 2003. I've build on top of the core ...
15 votes
Accepted

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

You can make use of the EnvironmentType enum that is available via the sp-core-library. The code for that would be as below: Add the below import statement. import { Environment, EnvironmentType } ...
Gautam Sheth's user avatar
  • 30.8k
14 votes
Accepted

Options for elevating permissions in SharePoint Framework

The thing with SPFx is that it is 100 % client side solution. It will always run in the context of the current user. There is no OOTB way to elevate permissions. To elevate privileges, you will have ...
Gautam Sheth's user avatar
  • 30.8k
13 votes
Accepted

SPFx List extension (Command set) - open custom side panel

The trick I found out was to open it inside a modal. Inside your webpart typescript file, add the below import statement: import MyCustomPanel from './MyCustomPanel'; Now, in your onExecuteMethod, ...
Gautam Sheth's user avatar
  • 30.8k
12 votes

Content Editor webpart Vs SPfx

If you're a disciplined and clever developer/team then the SPFx doesn't give you any functionality you couldn't develop yourselves In fact many companies have already developed their own framework ...
Per Jakobsen's user avatar
  • 32.4k
12 votes
Accepted

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

TSX allows for embedding JSX elements inside the file, and is largely used by React. TS files are plain old Typescript files and do not support adding JSX Elements. Typically you would seperate ...
James Randal's user avatar
  • 1,290
11 votes

'gulp serve' command opens SharePoint Framework workbench in a blank screen

In the 0.1.0 version of @microsoft/generator-sharepoint it has started setting gulp serve to use https. This is the right approach so you don't have to set your browser to allow unsafe scripts, but ...
Per Jakobsen's user avatar
  • 32.4k
11 votes
Accepted

use jquery functions within spfx webpart

You are trying to load javascript library as css. That's not correct. What you can do is to include jquery as your dependency under config and the use it inside web part. Here are the steps: Under ...
Sergei Sergeev's user avatar
11 votes
Accepted

Will the new SharePoint FrameWork increase speed?

"tells my Client all the Front-End dev I did in the past is oldfashioned" Depends on what you did and what he is talking about... in my perspective SharePoint is going client side just like its ...
Ali Jafer's user avatar
  • 17.8k
11 votes

What is SharePoint Spfx? Will it override SharePoint app development and server object model?

What is SharePoint SPFx? The SharePoint Framework (SPFx) is a page and part model that enables client-side development for building SharePoint experiences. It facilitates easy integration with the ...
Mohamed El-Qassas MVP's user avatar
11 votes
Accepted

Unable to load `/temp/manifests.js` on https

Finally figured out what was the problem. Before doing gulp serve run the command set NODE_NO_HTTP2=1. This will allow the manifestes.js file to be served over https. Before opening the SharePoint ...
Naveen's user avatar
  • 1,892
10 votes
Accepted

SPFx - How to call function on button click event from ts file with React

Add a property to your IAutoCompleteProps interface for your click handler. Then pass the function from the AutoCompleteWebPart into the interface as one of the component's properties. So in your ...
theChrisKent's user avatar
  • 5,971
10 votes

How does one pass parameters to SharePoint Framework Extensions in practice?

Using Properties in Your Extension The this.properties property of your extension are defined by the Interface you setup. By default, the interface gets defined in your main extension class file. ...
theChrisKent's user avatar
  • 5,971
10 votes
Accepted

SPFx webpart workbench on localhost is not connecting

you can avoid your problem by using http instead of https To do that, in config\serve.json set "https": false, and remove the "s" from the URL in the "initialPage" Save the file, restart "gulp ...
user1730's user avatar
  • 556
10 votes
Accepted

Hide/Disable property pane component based on another component's value

You can make use of a standard boolean check to determine whether your toggle component has value. Based on that, you can show/hide your slider component. You can do this bool check in the ...
Gautam Sheth's user avatar
  • 30.8k
9 votes
Accepted

How does Workbench.aspx in Office365 get local files?

The workbench.aspx inherits from Microsoft.SharePoint.WebControls.ClientSidePage which I assume uses the specified ClientSideApplicationId to load a specific Client Side Application. The id 8be81a5c-...
Per Jakobsen's user avatar
  • 32.4k
9 votes

Will the new SharePoint FrameWork increase speed?

as you state, SPFX doesn't have some special way to call REST endpoints that is faster. The sphttpclient object makes a standard web call (and uses the standard browser request underneath). ...
PatMill_MSFT's user avatar
  • 2,466
9 votes

SharePoint development past and "future": how to keep calm?

CSOM is the best thing to happen to the platform. It lets us run code where ever the hell we want, how we want. The REST API (not ListData.svc, that should never have made it into the release) took it ...
James Love's user avatar
  • 25.5k
9 votes
Accepted

Can SPFx Webpart and Extension exist in a single app?

Yes, you can have multiple webparts or extensions in the same solution. Think of it as a Visual Studio solution with multiple projects (i.e one sln file and multiple dlls). To add a webpart/extension ...
Gautam Sheth's user avatar
  • 30.8k
9 votes
Accepted

workbench page shows "This site can’t provide a secure connection" on creating SPFx Webpart

Are you using Node.js v8 by any chance? If so, there is a known issue with the http/2 experimental feature. You can disable it by setting the NODE_NO_HTTP2=1 environment variable. More information ...
Waldek Mastykarz's user avatar
9 votes
Accepted

Can't install app in AppCatalog

There is currently some issue going on at Microsoft's end(across most regions) because of which you are not able to install app in App Catalog. This is affecting both SPFx solutions as well as ...
Gautam Sheth's user avatar
  • 30.8k
9 votes
Accepted

Modern Site Page - Hiding total page Views and Like option in Office 365 SP Online

In my experience, it shows the total number of page views since page creation. Though, the method to calculate page views is not known to me, so it could be different. Its not stored in any hidden ...
Gautam Sheth's user avatar
  • 30.8k
9 votes
Accepted

SPFx calls blocked by CORS policy

The difference between jquery call and the native httclient call is a method of making http asynchronous request. jquery uses old good xhr, but httpclient uses modern fetch api. When making CORS ...
Sergei Sergeev's user avatar
9 votes

Using Office Fabric UI icons in a SPFx extension

This is currrently a SPFx limitation. You cannot directly use Fabric UI Icons as command set icons in SPFx list extension. Currently SPFx extension allows you only 2 ways to set extension icon, 1) ...
Gautam Sheth's user avatar
  • 30.8k
9 votes
Accepted

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

Web parts allow you to create components that can be added by content editors as content on a page. Extensions add functionality to known areas of pages on an entire site or site collection, for ...
Hugo Bernier's user avatar
  • 1,236
9 votes
Accepted

How get sharepoint list items by view(s) in spfx?

I am afraid you can't get items directly from view. You will get viewQuery field from below method using v.ViewQuery. then you have to use getItemsByCAMLQuery method to get items. Below are reference ...
Siddharth Vaghasia's user avatar
8 votes
Accepted

Does an SPFx webpart run on Gulp or Node as web server?

Neither Gulp or Node act as the web server. The web server used for SPFx is Connect, see below. These are (some of) the different moving parts in the SPFx workbench Node.js: is the JavaScript ...
Wictor Wilen MCA MCM MVP's user avatar
8 votes

SharePoint Framework – Loading Font Awesome CSS from CDN

In SPFX GA version the ModuleLoader was renamed to SPComponentLoader. import { SPComponentLoader } from `'@microsoft/sp-loader'; It continues to be userd in constructor: constructor() { super();...
rtcardoso's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible