Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [typescript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
27 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 ...
2
votes
0answers
31 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
56 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
174 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', ...
0
votes
1answer
48 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/...
0
votes
2answers
2k 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
1answer
2k 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 ...
0
votes
3answers
4k 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 ...
2
votes
1answer
5k 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 ...
2
votes
2answers
604 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 ...
0
votes
2answers
211 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
263 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
3answers
449 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
90 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 ...
0
votes
1answer
331 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="...
1
vote
0answers
204 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
1k 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
211 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
1answer
3k 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
61 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
147 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
516 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. ...
3
votes
1answer
377 views

SPFx - Template for Angular 2

I need to install an Angular 2 template, but when I try the GitHub templates I have mistakes. Would you give me a quality template or tutorial for Angular 2 with SPFx: Errors:
1
vote
1answer
802 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
189 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":[ { "...
3
votes
1answer
1k views

Office-UI-Fabric-react uncheck checbox

How Can I uncheck a checkbox dynamically from the code? I need to uncheck some checkboxes at the same time from the code when I press a button. I'm using: SharePoint Framework - Typescript - Office ...
0
votes
1answer
288 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 ...
3
votes
3answers
584 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 ...
3
votes
1answer
1k 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='+...
1
vote
2answers
193 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
432 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 ...
1
vote
1answer
395 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
1answer
224 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
1k 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
591 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&...
0
votes
0answers
173 views

CROSS domain calls in SharePoint Hosted App with React JS

I am developing a SharePoint hosted app with React JS for SharePoint Online. I am Using Typescript and web pack for the same. I am able to get items from the Lists from App web without any issue with ...
0
votes
1answer
2k views

TSLint Error: Argument of type 'SPHttpClientConfiguration' is not assign able to parameter of type 'SPHttpClientConfiguration'

Unable to Build my SharePoint solution. When building, each of my webparts has the error "Argument of type 'SPHttpClientConfiguration' is not assign able to parameter of type '...
0
votes
1answer
113 views

Ribbon not initially rendered when using CSR in conjuction with React and TypeScript

we have designed a few custom fields using CSR, TypeScript and React. On our AllItems.aspx, we use this to render a link for a "cross-site" lookup field which is really just a text field holding a ...
2
votes
1answer
626 views

How to include office ui fabric CSS font specifications

Since I updated my SPFx webpart today to > npm update: +-- @microsoft/sp-build-web@1.2.0 +-- @microsoft/sp-core-library@1.2.0 +-- @microsoft/sp-module-interfaces@1.2.0 +-- @microsoft/sp-webpart-...
1
vote
0answers
135 views

Problem getting typescript class to work with CSR

I am trying to write a TypeScript/React class that will only get instantiated once and is accessible globally. The reason for this is a SharePoint CSR script. I load this script for New/Edit/Display ...
2
votes
0answers
66 views

Redirect to DisplayForm after Item has been saved using CSR and TypeScript

I have a problem that's really bugging me. I am trying to redirect the user to the DisplayForm once he has created a new ListItem in NewForm. I have two problems: I don't know how to get the ID of ...
3
votes
1answer
197 views

SharePoint 2013 : Calling function in javascript file from Ribbon button

I am trying to call a function in an external javascript file from SharePoint 2013 ribbon button. I have a Typescript file and i am using Webpack to transcompile it to javascript. When i try to call ...
0
votes
1answer
241 views

SPFx - Wrong function return current user formatted name

I'm beginner with TS and promises. I want to know Why function is returning empty string? How to format my function to return current user formatted name? The request is executed after the function ...
3
votes
1answer
1k views

How to enable Async/Wait in SPFx Typescript, tslint: Missing semicolon, TS1005: ',' expected, TS2304: Cannot find name 'await'

I am trying to use async / await for developing a SPFx WebPart. The sample react-async-await-sp-pnp-js in sp-dev-fx-webparts compiles and runs fine on my computer. When I try to use async / await, ...
1
vote
0answers
703 views

How to use Office UI Fabric Callout in SPFx WebParts?

I try to use a good pattern to use the Callout, for instance when hovering over a Persona element. Currently I do the following: _clientPersonaElement is a reference to the Element the Callout uses ...
1
vote
1answer
1k views

How to debug SPFX Web part in visual studio code ?

I am trying to find a way to debug my local SPFx workbench from Visual Studio Code, For this have installed the "skritt-debugger" and the launch.json Look Like this "configurations": [{ "...
2
votes
2answers
933 views

Getting error in $.Get in SharePoint Framework

I have created following function in webpart.ts file to retrieve stock data from the Yahoo finance, protected demo():void{ var symbol='goog'; var url = 'http://query.yahooapis.com/v1/public/...
0
votes
1answer
249 views

HTML does not render properly in SharePoint Hosted App with Angular 2

I am trying to create a very basic SharePoint Hosted App with Angular2. App deployed successfully but it does not render the html properly. And I am stuck at this initial level only. refer below ...
0
votes
2answers
303 views

how to fetch document library data in SharePoint Framework, Modern UI

to build a simple web-part to display document library using SharePoint Frame Work, that using type script how to get connected to SharePoint Document Libraries?
0
votes
2answers
409 views

SharePoint set MultiLookup field using CSR and TypeScript

I am trying to set the value of a multi lookup field. I am rendering my field using CSR and using registerGetValueCallback to get the value of my lookup field. But the value of my field does not ...