Questions tagged [typescript]

The tag has no usage guidance.

1
vote
2answers
159 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: ...
1
vote
2answers
2k views

Import SP.js to typescript (Angular 4) application and use JSOM

I would like to use JSOM for things like creating Caml queries as I have to migrate AngularJS to Angular 4. The app is running in a WebPart. Unfortunately there is no npm package for this. How can I ...
0
votes
2answers
162 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
2answers
1k 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 ...
3
votes
1answer
181 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 ...
2
votes
1answer
428 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 ...
1
vote
1answer
145 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":[ { "...
1
vote
1answer
330 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: ...
1
vote
1answer
107 views

Object doesn't support property or method '$1Q_0' when using cascading executeQueryAsync

I have a very annoying problem. I get the above error every time I execute below code. It happens at the second executeQueryAsync call. The error callback isn't hit nor did I find anything interesting ...
0
votes
1answer
11 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
1answer
49 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
52 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
135 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
34 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
1answer
59 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
177 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 ...
0
votes
1answer
44 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
1answer
102 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 ...
0
votes
1answer
219 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 ...
2
votes
0answers
25 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
45 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 ...
2
votes
0answers
74 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 ...
2
votes
0answers
58 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 ...
1
vote
0answers
73 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 ...
1
vote
0answers
128 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 ...
1
vote
0answers
379 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
0answers
20 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
25 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
0answers
133 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
vote
0answers
143 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
0answers
213 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
0answers
109 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 (...
1
vote
0answers
123 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 ...
1
vote
0answers
586 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 ...
0
votes
0answers
22 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, ...
0
votes
0answers
19 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
0answers
38 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
16 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
0answers
51 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
0answers
83 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. ...
0
votes
0answers
94 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 ...
0
votes
0answers
150 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 ...