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
0
votes
0answers
9 views

Are there typings for the SharePoint and MS Project JSON objects you get from the REST APIs?

I'm working on an SPFx webpart that is going to interact with Project Server, and I'm finding myself setting up things like this: export interface ISelectProjectModalProps { allProjects: any[]; ...
0
votes
1answer
34 views

Get current theme colors for SharePoint Online site in SPFx webpart

I have a SharePoint Online site with green theme color currently set. In my SPFx webpart I want to be able to get the current theme color (primary, secondary and tertiary) in TypeScript code. Below ...
0
votes
0answers
23 views

Jest with SharePoint Framework. SyntaxError: Unexpected token export

I'm trying to do tests on an SPFx project with Jest and Enzyme. I have configured the environment using Andrew Connel's preset to test my solution with React and Typescript. After run 'npm test' I've ...
0
votes
0answers
18 views

Property 'select' does not exist on type 'Web'

I'm trying to use @pnp/sp with SPFx like shown on pnp GitHub page: sp.web.select("Title").get().then(w => { console.log("title: " + w.Title); }); When compiling the following TypeScript error ...
0
votes
2answers
46 views

import interface in mystrings.d.ts

I want to add multiple languages to my spfx web part. Now I want to import some interfaces to my mystrings.d.ts declaration file. But when I do that it breaks the definition and I get a lot of errors ...
0
votes
0answers
24 views

File not found error JSOM Sharepoint file uplaod

The code was working perfectly and suddenly this error: "Request failed with error message - File Not Found. Stack Trace - undefined" comes out, can some please help me? onFileSelected(event) { ...
0
votes
3answers
64 views

Sharepoint Online No JS Framework, how can redirect to one modern page to another?

I am using: window.location.replace('https://site.sharepoint.com/sites/ExternalSharing') Also I tried using href. The problem is that when I clicked on the button for redirection the new page is ...
0
votes
0answers
21 views

PnP JS Core : Uncaught (in promise): TypeError: Cannot read property of undefined

I am using PnP js in one of my angular 6 project. I have a function which is defined in the Component, but I am getting this error at run-time when calling from inside the success of PnP SP js: ...
0
votes
0answers
28 views

Sharepoint Online Only, Web Part: Trying to query SQL Server

Let me first say that I'm sorry if this post seems rather vague. I've been trying for weeks now to connect to SQL Server from a custom Web Part i'm creating using Visual Studio Code, TypeScript, Node....
0
votes
1answer
63 views

tslint.json unknown compiler option 'extends'

i try to upgrade my WebPart to SharePoint spfx 1.9.1, i follow recommandation generated by o365 spfx project upgrade --output md > report.md, but when i build my project i get two errors : [16:10:...
0
votes
0answers
45 views

How to display content of Rich text on webPart

On my SharePoint list, I have a rich text with picture. When I retrieve it on my webPart, the picture doesn't get displayed. I obtained plain text but how can I display picture. i already tried this ...
0
votes
1answer
216 views

How make accordion detail list with UI fabric react

I start with UI Fabric react; I am developing a FAQ; I use for that a list; but the result is not good; I want to do something looks like an accordion, where we can see the question as a header and ...
0
votes
1answer
28 views

How use result of pnp response

I use PnP for getting SharePoint list item. But I don't really know, how use the result of my function. I wish to get items of my SharePoint list using PnP and assign it to my list. My code don't ...
1
vote
3answers
85 views

get sharepoint list with pnp [closed]

I want to get a sharepoint list and assign it to my list 'items' which of type is IExampleItem, but I don't really know how to do it; I tried the following code but it gives me an error, my list '...
0
votes
1answer
40 views

How show a value when clicking on a table row

I am a beginner with sharepoint and typescript, i have dynamic table, and i want to get value of row when i click on private _renderList(items: ISPList[]): void { let html: string = '<table ...
0
votes
1answer
39 views

Assign permission of the current user to a list item programmatically

I am making an event web part which is connected to a list of items. When a user attends an event, a json object will be parsed to a txt document that is attached to that particular list item /event. ...
1
vote
1answer
64 views

JSOM in React, 'SP' is not defined no-undef

I am making some tests in order to update a page on sharepoint on premise 2013. The goal is to use reactjs to modernize this page. However, when I try to use JSOM, especially to create an item, I ...
0
votes
1answer
52 views

Q: Set Folder's path according to it's title in a list with SPFx

I am creating a folder inside a List with the following code: TypeScript import {sp} from "@pnp/sp"; const shpList = sp.site.rootWeb.lists.getById(ListId); shpList.items.add( { Title: folderName, ...
1
vote
2answers
233 views

Q: Create list item inside folder with SPFx

I am trying to create an item within a folder in a list. Is there an approach with pnpjs that looks like the following? TypeScript import {sp} from "@pnp/sp"; const shpList = sp.site.rootWeb.lists....
0
votes
2answers
67 views

Q: Create visible folder in list with SPFx

Having the following code in an application extension: TypeScript import {sp} from "@pnp/sp"; /*******************************************************************/ const shpList = sp.site.rootWeb....
1
vote
0answers
82 views

(Problem)SPFx rendering items from RSS after selecting number of items you want to display with slider

I am currently building an RSS webpart in SPFx using React as a framework. Now I am in the stage that I want the user to be able to select how many news items he/she want to see with a slider (taken ...
0
votes
1answer
53 views

SPFx React webpart is not displaying all XML items from RSS News Feed

I am currently building an RSS News Feed in SPFx using React as a framework and using an XML link https://feeds.expressen.se/nyheter/ (Swedish news if curious). I can display all items, in this case ...
1
vote
0answers
101 views

Issue with rendering XML data in SPFx

I am in a project of making a RSS feed in SPFx and using React.js and TypeScript. When I try to retrieve XML data from a news site, the console gives error: Because it complains about CORS, so I ...
0
votes
1answer
20 views

Call child component method in parent and visa versa

how can I call a parent components methods from child or visa versa. I'm using reactjs and typescript in spfx webpart. Or should I use helper classes to call methods of another classes from anywhere?...
0
votes
0answers
181 views

Q: Get item URL from a lookup field using pnp/sp javascript library

Set up: Something that may be relevant is that the Sharepoint is in spanish. The script accesses a list to know if the current user has read the mandatory information. This list has a reader field and ...
0
votes
0answers
26 views

Extend Document Information Panel (DIP) with Data from API

The document information panel in SharePoint Online modern view Document Library shows the properties configured in the Site Content Type as well as general sharing or modification information from ...
0
votes
1answer
119 views

Problem with SPFx TypeScript json.value.map(k,i) & query via getuserbyid()

Firstly I'll start with extra question: I'm trying to get data by _api/web/getuserbyid() API call in code. Do You guys know why there is no option for filtering by query for specific data? I mean by: ...
0
votes
1answer
50 views

Make web part compatible for IE11

I have a web part that works for every browser but not in IE. It seems to have troubles with "startsWith" which is a function that is not supported in IE11, fair enough. But when I changed the code ...
0
votes
0answers
391 views

SPFx TypeScript json response from spHttpClient as array

i want to get data to WebPart from the SharePoint list. but some of the data are eg. PeoplePicker or Multiple line of text and I have result shown as: <div class="...
0
votes
1answer
189 views

SPFx web part: wait for fetching data before rendering header

I already asked this question regarding SPFx extensions. But now I have the same problem I had in that question, but for a SPFx Web part. I use the exact same _getUserInformation() method as ...
0
votes
1answer
412 views

SPFx Extension: wait for fetching data before rendering header

I am currently developing a SPFx Extension (Application Customizer). I am relatively new to TypeScript (C# developer) and I can't find my error. I have the following onInit method: @override ...
1
vote
0answers
356 views

SPFX- Lookup column value

I'm retrieving data from a SharePoint list and I'm facing some issues while getting values from lookup column. I was able to successfully pull in the 'Title' column which is a single line of text, but ...
0
votes
1answer
315 views

SPLoaderError loadComponentError

I clone the mentioned SharePoint App. Did a npm install. When I run gulp serve, it shows the following error. Please do the needful. [SPLoaderError.loadComponentError]: ***Failed to load component ...
0
votes
1answer
55 views

How to send mass emails with only BCC recipients but not To?

I am trying to send some subscription emails, need all the email addresses in BCC. I tried something like this const requestUrl = `${this.baseUrl}/_api/SP.Utilities.Utility.SendEmail`; const ...
0
votes
0answers
135 views

SPfx CKEditor 5 adding additional plugins

hopefully i'm not being too dense here. We have a requirement that a WebPart includes the CKEditor V5. But we need to implement some of the third party plugins that are listed on the CKEditor website. ...
2
votes
1answer
303 views

Using TypeScript global variable with SharePoint functions

Using TypeScript and Angular, I have created a function named getTasks() that I want to fire when a modal is closed. This is the function: getTasks() { this.http.get(`https://example.com/_api/web/...
2
votes
2answers
42 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 ...
2
votes
0answers
859 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
584 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
143 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
267 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
46 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
193 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
23 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
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 ...
1
vote
1answer
288 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
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/...