Hot answers tagged

2

Pete, If you're planning on building a new solution, I'd say that Ganesh's answer is the right one; use the latest version of SPFx and Node + Gulp as per the documentation. However, if you're trying to work with an older version of an SPFx solution, or if you're testing out a sample from https://aka.ms/spfx-webparts, you may want to refer to the ...


2

You cannot get the type of list while using lists.getByTitle("<name>").items endpoint. You can identify the type of list based on it's BaseTemplate like below: let colsToSelect: string[] = []; const r = await sp.web.lists .getByTitle(listName).select("BaseTemplate")(); if (r.BaseTemplate === 101) { console.log("It's a ...


1

SharePoint Server 2019 supports SharePoint Framework client-side web parts hosted on classic or modern SharePoint pages built by using the SharePoint Framework v1.4.1. SharePoint Server 2019 also supports SharePoint Framework extensions hosted on modern SharePoint pages built using SharePoint Framework v1.4.1. This means that when you're targeting the ...


1

OOTB capabilities: You can setup header/footer navigation using OOTB settings. You can use different types of header layouts like minimal/compact/standard/extended, menu styles like Mega menu or Cascading menu. You can add links as well as labels in navigation References: New Site Header Options in SharePoint Online Customize the navigation on your ...


1

You can use SP PnP JS library to like/unlike list items/site pages. Example: import { sp, IItem } from "@pnp/sp/presets/all"; import "@pnp/sp/comments/item"; import { ILikeData, ILikedByInformation } from "@pnp/sp/comments"; // get a specific item by id. let item: IItem = await sp.web.lists.getByTitle("My List").items....


1

Try using like this: private _onRenderListCell = (colour: IColour, index: number | undefined): JSX.Element => { return ( <div> {colour.title}<br /> <DefaultButton text="delete" data={colour.id} onClick={() => this._onButtonClick(colour)} /> </div> ) } OR const _onRenderListCell = (...


1

If you're using Node.js v12+ or higher, you must use Gulp v4+. If you're using a version of Node.js lower than v12, you must use Gulp v3. Documentation: Set up your SharePoint Framework development environment


1

If you are using PnP JS, you can import FieldTypes using below import statement: import { FieldTypes } from "@pnp/sp/fields/types"; This enum has below values: /** * Specifies the type of the field. */ export declare enum FieldTypes { Invalid = 0, Integer = 1, Text = 2, Note = 3, DateTime = 4, Counter = 5, Choice = 6, ...


1

Your options are limited because spfx code is browser-based. The "correct" answer is to use Azure App Insights, or some other instrumentation provider like Google analytics. They're easy to set up and require nothing else to build. Your alternative would be to publish an API and log to that over HTTP. You can use any storage mechanism you wish, but ...


1

Deploying at tenant level is not a good idea when you have multiple site collections. Suppose you have develop site collection as: HR IT Facilities and each site collection has apps that are not relevant to other collection, deploying everything at tenant level will end up huge list of apps and it would be difficult for tenant administrator if for some ...


1

I just tried this on my office 365 tenant. First deployed SPFx package to site collection app catalog Then deployed same SPFx package to tenant level app catalog Then edited a site page & tried adding web part on page Findings: I can see only one SPFx web part If site collection app catalog is enabled & same package is deployed at both levels, I ...


1

As soon as I read the title of this post I thought, "I bet he's using absolute positioning". Absolute positioning detaches the elements from normal page flow. So yeah other elements will render over the top of it. Also it looks like you've set theImage and theText to render in the exact same location.


1

I have tried this code <div class="${ styles.row }"> <div class="${ styles.column }"> <Label ><h3><b>Please upload PDF files only</b></h3></Label> <br/> <input type="file" accept=".pdf" name="file-1[]&...


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