Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [typescript]

The tag has no usage guidance.

2
votes
2answers
28 views

Where is the documentation for javascript for the pnp libraries?

I am trying to build a SharePoint Add-In and I am struggling because all documentation seems to be in TypeScript. I am sure TS is great but I don't have time to learn it right now. Does MSFT not have ...
1
vote
0answers
14 views

@types/react and @types/prop-types errors when building with gulp build or gulp serve

For my team's project, some of us are hitting a type issue when building. We're using version 1.7.0 of all the @microsoft/sp- packages. tslint version: 5.9.1 typescript version: 2.4.2 Build tools ...
1
vote
1answer
15 views

Get current folder within SharePoint document library with @pnp/sp

I need to get the folder name within a document library, within the ListCommand spfx extension. Is there a way to do that with REST ? can I use @pnp/sp ? I have imported the project with : import { ...
0
votes
1answer
25 views

SPFx - Accessing/appending markup that has been entered in via a property pane text field to webpart

I am currently working on an SPFx webpart. Within my property pane I have: PropertyPaneTextField('CreateNewVerticalNav', { label: 'Create New Vertical Nav', multiline: true, ...
0
votes
1answer
33 views

Spfx dropzone component

I am using the sample react-file upload sample and upon and upload am changing the metadata of the file. The catch is it is working when am testing and when the app is deployed it no more works.The ...
1
vote
1answer
32 views

fetch all the termstores from a current site in sharepoint

public taxonomy() { SP.SOD.registerSod('sp.taxonomy.js',SP.Utilities.Utility.getLayoutsPageUrl('sp.taxonomy.js')); SP.SOD.executeFunc('sp.taxonomy.js','SP.Taxonomy.TaxonomySession',function()...
0
votes
0answers
27 views

Update file metadata in an spfx webpart

i am trying to update a file properties that i have just uploaded. Once the file has been added to the library,i am doing another http request to get the file properties but it is not working.i can't ...
1
vote
0answers
9 views

Two search web parts on the same site not working (only in the same page)

I have two search web parts. The are based on each other, that is is that they pretty much does the same thing with some lesser tweaking. The have different product ID and alias. Only the code is ...
1
vote
0answers
20 views

Working with npm packages in SharePoint hosted app

I am starting to work on a SP 2013 hosted app. I am planning to use typescript and have setup my project with Typescript configurations enabled. I have created a SP module called "dist" and all ...
1
vote
1answer
35 views

Submit SharePoint 2013 form with custom Save button in Typescript

I've been searching on this issue for a few days now. We use JSLink to add an extra Save button to a New or Edit form. So each form has 3 buttons: Cancel -> cancel the form Save -> (Temporary) Save ...
2
votes
0answers
18 views

permissionKind returns void in React

I have a search function that returns all list items including their parent link based on their content type, tenant-wide. Every list item comes from a specific subsite and I want to split the ...
2
votes
0answers
21 views

I need to get all properties of taxonomy termstrore. which I already get are “Label”,“WSSId”,“TermGuid” but I need to get Other labels as well

Is there any solution to get other properties for taxonomy termstore. As I remember, I usually used "include" to get all properties which I mentioned in JSOM. But now I need to work by using ...
1
vote
0answers
37 views

Set current user in Fabric.UI people picker

I'm struggling setting the current user to a people picker control in Office.Fabric.UI const people: (IPersonaProps & { key: string | number })[] = [ { key: 1, imageInitials: 'PV', ...
-1
votes
0answers
36 views

How to create SharePoint typescript react module

I'm trying to make my own module which allows to create component templates and transpile everything to a single js file to be able to use it as external templates in SPFx webparts. Currently i'm able ...
0
votes
1answer
30 views

Get List items by specific content type from site and subsites

I'm trying to extract list data from a site (with REST query) and its subsites based on their content type and put everything in a different list. For example from https://mytenant.sharepoint.com/...
2
votes
1answer
150 views

Add Dynamic Property Panes to SPFX

I know this has been asked 1000 times, but i've tried everything in the first 2 pages of google so i've decided to come to you guys for help. I'm trying to create some dynamically added property ...
0
votes
1answer
665 views

SharePoint Online full-width page

I am still exploring SharePoint Online creating webparts and deploying through visual studio code using Typescript. I created a HelloWorld webpart and uploaded it on page. I was able to create ...
0
votes
2answers
107 views

SPFX Angular *ngFor not working with routing

Iam using Angular project from Sahil Malik's blog Use SPFx with Angular and Angular CLI as a startup solution/project.... And i implemented "@angular/router" for routing with some test pages. Just ...
0
votes
1answer
93 views

With PNP JS, How do I handle odata.null return values?

I'm using @pnp in my SPFX project, and I need to get tenant property. The code is as followed: sp.web.getStorageEntity('mytenantproperty1') .then((prop: StorageEntity) => { //How do I ...
0
votes
0answers
24 views

Scroll in SharePoint 2013 and Angular 2

I am writing an app for SharePoint 2013 with Angular. I know that window.scroll not firing here and I should use document.getElementById("s4-workspace"). The problem is that all foreign directives ...
0
votes
3answers
243 views

Reactjs, TypeScript & Webpack on SharePoint2013

I know that Reactjs, TypeScript & Webpack can be used on SharePoint Online to create web-parts. But can it be possible to create web-parts for SharePoint 2013 on premise. Please let me know if it ...
2
votes
0answers
59 views

TypeScript and SharePoint Framework question - although works but does it represent correct design?

Thanks for reading my question. I am just beginning to learn TypeScript and from my understanding so far I have created the follow code to retrieve list items from a list. The code works but I am not ...
1
vote
0answers
83 views

Not able to print HTML based on If statement

So I'm trying to print some HTML code depending on the IF statement. but I'm getting "undefined[object Object][object Object][object Object]" public render(): React.ReactElement<ISPWebPartProps&...
1
vote
1answer
391 views

SharePoint Framework - basic read list items using typescript

I have a question on the following code. All of the code is taken after reading through various get started samples and then tweaked it a bit. I am trying to figure out how it works which is straight ...
2
votes
1answer
109 views

SPFx extension unrelated ApplicationCustomizerContext type tsc error

I have encountered dificulties using the ApplicationCustomizerContext type and the TypesSript 1) I have created a spfx application customizer 2) I have added in the application customizer main ts ...
1
vote
0answers
145 views

sharepoint framework call async function

Help please, I'm trying to call the function to get the number of comments from the modern page, but I can not correctly display the result in the html code: private async getSitePageComments(id: ...
1
vote
1answer
696 views

SPFx - Get User ID from User Login Name

As the title suggests, does anyone have a working method for getting a users ID from a users Login Name (not the one signed in)? Login name like: i:0#.f|membership|firstname.lastname@contoso....
1
vote
1answer
30 views

“Converting” project from old to new technology?

I am working on a SharePoint project which started a couple of years ago. It started with SP 2013 on - prem, and we are now on SP 2016 with feature pack 2. In the project we used the Powershell based ...
1
vote
0answers
74 views

How to use jquery.slimscroll in spfx

I want to use slimscroll for a couple of SPFX webparts but having trouble to get things going. I used: npm i jquery-slimscroll npm i @types/jquery.slimscroll next to a couple of other modules (...
2
votes
1answer
178 views

How to add items to SPO list synchronously in spfx webparts?

I have twelve items that need to be added to a list on button click. I am using the sp-pnp-js library to add items. But the function adds items to the list asynchronously. I have tried many ways. ...
0
votes
1answer
394 views

Add OnClick Event to SPFX Html - No Framework

I have an SPFX Web Part (No Framework) and would like to add an onClick event to my which will call my function swap(). Code: export default class ExpandableIFrameWebPart extends ...
0
votes
2answers
682 views

Spfx, WebParts and PnP : How to get the current user id?

Good morning every SharePoint fellow ! I know this question has surely already been posted, but i could'n't found a clear answer. Context I am programming a custom WebPart for Sharepoint online with ...
0
votes
0answers
186 views

'SPHttpClientConfiguration' is not assignable to to parameter of type 'SPHttpClientConfiguration' #spfx

I have updated my packages to the latest version as per https://docs.microsoft.com/en-us/sharepoint/dev/spfx/toolchain/update-latest-packages, deleted all items in the node_modules folder and re-...
0
votes
1answer
427 views

Working example with sp.profiles.clientPeoplePickerSearchUser from PnP @pnp/sp

I'm trying to take advantage of the people picker search helper in the PnP-JS-Core, but I get a JSON error in SP2013, 2016 and SharePoint Online. The error is the same everywhere. If I try to get data ...
1
vote
1answer
103 views

Mapping json out to typescript in spfx

I have the following json output : "ParentTerm":{ "Name":"Accounting", "ID":"e8c3c601-d3e0-4499-b0ad-3b520924af15", "Root":true, "ChildTerm":[ { "...
0
votes
1answer
180 views

Why doesn't DOM element behave when setting visibility or display with SPFx/Typescript?

code snippets here produce/render expected data and alert box shows [object HTMLDivElement] the div will not hide; same is true using "visibility", "hidden" <p> <input id="...
3
votes
3answers
287 views

SPFX- Array.prototype.diff - (TS) property “diff” does not exist on type 'any[]'- es6 issue?

I have some code that takes a SP List item column (a news article tagged to one or more choice categories) and want to show that to users who have a user profile property with one or more categories ...
0
votes
1answer
222 views

Sharepoint Framework/PnP-JS/React : state Object doesnt work

I have created a property (age) in the state Object. However, I can not access this property in my code. I am getting an Error Message: Property 'age' does not exist on type '{} Here below is my ...
0
votes
0answers
528 views

SharePoint Hosted App with TypeScript and AngularJs 5

I want to create a small SP hosted App which uses TypeScript and AngularJs5. Can anyone provide me step by step guide to create such App. If possible please provide a sample App code. It would be ...
3
votes
1answer
703 views

how to use click event in html string in spfx (react)

I have a html string embedded in a map function like this pnp.sp.web.lists.getByTitle("Division").items.select("Title","ID").get().then((item: any[]) => divtree=item.map(per =>'<li id='+...
0
votes
1answer
1k views

SPFX list view WebPart with react, list data loaded with PnP js, but not rendering

I have created SPFX webpart with react framework. I successfully get data from SharePoint pnp bu in react data is not loaded. When I resize browser window then data displayed successfully. Please see ...
1
vote
2answers
133 views

I have upgraded from yeoman 1.3.4 to 1.4.0 and I cannot import mystrings.d.ts

I have a file mystrings.d.ts which contains :- declare interface IReactSearchBoxStrings { PropertyPaneSearchOptions: string; BasicGroupName: string; DefaultSearchResultsPageUrlFieldLabel: ...
0
votes
2answers
274 views

SharePoint 2016 On Premise Dev using SharePoint Framework

This is my first question in this forum ;) I need to develop SharePoint 2016 On Premises solution in Visual Studio using the SharePoint Framework. i did some RnD over it and found a nice articles on ...
2
votes
2answers
338 views

Add external libraries in SPFx?

How to add external libraries like material-ui to our Spfx Webpart? I know to add external libraries having their CDN link and types definition like jquery but don't know how to add libraries which ...
1
vote
1answer
278 views

How to attach click event for elements rendering inside map function inside

I am using SPFx to create web part. I am generating checkboxes dynamically with map function. below is render method code public render(): React.ReactElement<IQuickSurveyProps> { let styles: ...
0
votes
0answers
71 views

SPFX Web Part, once deployed only runs in Edit Mode on a classic page

I have an SPFX Web Part, no framework in it, I have an alert("Hello"), I build and deploy the app package and add the web part to a page but nothing happens, unless im in edit mode, and then it does ...
0
votes
3answers
2k views

_spPageContextInfo.siteServerRelativeUrl is undefined

The _spPageContextInfo.siteServerRelativeUrl is undefined which i'm using to acquire information about the web parts on a page. unfortunately, the value always returns undefined. I tried using the ...
0
votes
1answer
147 views

Url to stop following a document

I'm working with TypeScript and SharePoint Framework in SharePoint Online. I know that I can see all documents I follow by typing the following url in my browser: https://[my-tenant]/_api/social....
1
vote
1answer
777 views

(spfx) 'SPHttpClientConfiguration' is not assignable to to parameter of type 'SPHttpClientConfiguration'

I've been fiddling around with this issue for some hours. Here's my dependencies: "dependencies": { "@microsoft/sp-core-library": "~1.1.0", "@microsoft/sp-http": "^0.1.2", "@microsoft/sp-...
1
vote
0answers
414 views

Typescript Angular Cannot find name [closed]

I am working on Aspnet Core Angular project and getting following error: TS2304: Cannot find name 'email'. The code is executed in visual studio 2017. postEmailValidate(email?: string): Observable&...