New answers tagged

1

I would suggest adding a selectedUsers value to your state, which you could set in your constructor's state initialization to this._employeeName, then you would change the selectedItems attribute in your PeoplePicker to selectedItems={this.state.selectedUsers} At that point you would be able to use whatever logic you need within your component to call this....


0

It should work to set this._employeeName to null and to reset user state you are using for defaultSelectedUsers this.state.userMail to []. By setting the state you trigger a rerendering while you deleted the current selected information by setting _employeeName to null or undefined


2

Try following steps: Run npm i modernizr and then npm i @types/modernizr --save-dev. Then add its reference to config.json in externals{} like: "externals": { "modernizr": { "path": "node_modules/modernizr/src/modernizr.js", "globalName": "modernizr" } } Then reference the file in your WebPart.ts file like: ...


0

It seems like modernizr script from the CDN does not contain any modules. Try to use SPComponentLoader. import { SPComponentLoader } from '@microsoft/sp-loader'; Inside your render() or onInit() method (onInit() is more preferable, because it runs only once): SPComponentLoader.loadScript('https://code.jquery.com/jquery-2.2.4.min.js', { ...


0

I found my answer. Started playing around with it by only loading PS.js, but when trying to do a simple const ctx = new PS.ProjectContext('https://server/pwa/my-pwa-instance'); I got a reference error 'SP' is not defined. So if SP is required, I figured all the other dependencies are required as well. private componentDidMount = (): void => { ...


1

For disabling multiple responses, just go Settings of the survey -> Title, description and navigation and set Allow multiple responses in survey options to Yes/NO. By default this options is NO. For the requirement "show survey questions only to end users without default view of survey list in home page" I assume you want to prevent users from viewing ...


1

Try Using something like below: var ItemArray = []; var internalNameOfTitleCol = "Title" var titleColValue = "Here is a dynamic value for list item Title"; var body = {}; body[internalNameOfTitleCol] = titleColValue; ItemArray.push(pnp.sp.web.lists.getByTitle('listdisplayname').items.inBatch(batch).add(body)); Promise.all(ItemArray).then(function() { ...


0

I solved my issue by creating componentDidUpdate method with parameter interface of weather and checking old and new value if value mismatch then I will call getWeather and getLocation which will re-render component with new value. public componentDidUpdate(prevProps: IWeatherProps, prevState: IWeatherStates) { let _units = this.props.units ? 'us' : '...


0

I never had this issue by my self but I recently found this: import { sp } from "@pnp/sp"; sp.setup({ ie11: true, // set ie 11 mode }); source: IE11Mode - PnP/PnPjs Seems to be an alternative to your way. Would be nice to know if it works. In addition to the polyfill package I read that you should load polyfill as the very first package and than the ...


0

Have you checked if the features for those webparts is still shown in the site/sitecollection features option? I've had some occasions where deleting the packages didn't delete the features for reasons unknown. Other times, the deletion took a lot of time (24h+)


2

Try using base64-encoded image as recommended in below documentation: When using a custom image, rather than specifying an absolute URL to the image file hosted together with other web part assets, you can have your image base64-encoded and use the base64 string instead of the URL. A number of services are available online that you can use to base64-...


0

Check if you have delete the SPFx web part from the recycle bin, both from the first stage and second stage recycle bin. I suggest you follow the article below to uninstall(Remove) SPFx web part in SharePoint Online. To uninstall (Remove) SPFx web part in SharePoint Online


-1

I assume that you are using NodeJS 12. The current supported LTS version of NodeJS for the SharePoint Framework is Node.js v8.x and Node.js v10.x (recommended). Node.js v12.x is not currently supported. Notice that Node.js 9.x or 11.x versions are also not supported with SharePoint Framework development.


0

Open the solution in Visual Studio Code, open launch.json file in ".vscode", modify the url for "Hosted workbench", then debug the code and check if the web part can show in IE browser. If still not showing in IE, reopen the IE and try to run "gulp serve" again.


1

As per my understanding, SPFx webparts are responsive by design. So, most of the times you don't need to use bootstrap or media query. It is recommended to use Office UI Fabric React components (not compulsory) which is a responsive and simple for you to create web experiences by using the Office Design Language. Read more at Design considerations for ...


1

I finally got the groupId with the following code: sp.web.select("AllProperties").expand("AllProperties").get().then(w => { console.log(w.AllProperties.RelatedGroupId); });


2

Please use npm install for ..\sp-starter-kit-master\solution folder path: Then use gulp serve in the same path like this: In workbench, The Tiles web part can be found and use:


3

You could use react-slick slider. Sample test demo in my SPFx: You could customize the Previous Next as image instead of text. Update: The library supports custom HTML. Update part2: My test component(many test scenarios, ignore others) import * as React from 'react'; import styles from './ReactSpFx.module.scss'; import { IReactSpFxProps } from './...


2

As per my understanding adding dots is not possible as of now (correct me if I am wrong). However, you can add style to your previous and next button using prevButtonStyles and nextButtonStyles as given in documentation. Or as a work around you can use React Carousel control: Carousels.


0

adding below css made my image and carousal responsive .img-responsive { width: 100%; height: auto; } Hope this may help somebody


1

I needed an account on the tenant domain - It turns out that for SharePoint Online at least you need an account on the domain to access and use the web parts. I am using a persons account who has left the company and I can see the web parts and have no trouble. As an external user, I could not use the web parts but now I can.


1

The following code for your reference. import * as React from 'react'; import styles from './HomePageCarousel.module.scss'; import { IHomePageCarouselProps } from './IHomePageCarouselProps'; import { IHomePageCarouselStates } from './IHomePageCarouselStates'; import { Carousel, CarouselButtonsDisplay, CarouselButtonsLocation } from '@pnp/spfx-controls-react/...


2

You should check if, in the settings of the group, the Who can view the membership of the group? is set to Everyone. It is probably set to Group Members so you should change it to Everyone. You can check that setting by going to https://SITEURL/_layouts/15/user.aspx , then clicking on group name and choosing the menu item Settings -> Group settings.


0

Depending on the properties you would like to access, you could pull this from the SharePoint Search REST API Another option is using the Microsoft Graph API. You can play with that using the cool Graph Explorer and see what the different calls will provide you with. For example, this one will give you details about a specific user account: https://graph....


0

ok then. I hope this one will do it ;-) This method gets all siteUsers: //get all users with access to the sitecollection get fetchSiteUsers(): Promise<IPersona[]> { return this.getWeb().siteUsers.get().then(spUsers => { console.log(spUsers); return spUsers; }); } alternatively you can retriev a single User by using ...


0

I hope this method will help. It retrieves a list with expanded Userinformation. You need to extend a Person/Group Field (like Created by) when retrieving list items, then you can get user ID, Mail, Department and so on. import { sp, Web, List} from "@pnp/sp"; public getItemsExpandedUser(listTitle: string, selection: string[], expandField: string): Promise&...


1

By specifying that the response should be of type blob you should be able to do this: this.context.msGraphClientFactory .getClient() .then((client: MSGraphClient): void => { client.api('/users/xxxxx@xxxxx.com/photo/$value') .responseType('blob').get().then((response: Blob) => { const blobUrl = window.URL.createObjectURL(response);...


Top 50 recent answers are included