sp-dev-fx-webparts/samples/sharepoint-crud
Hugo Bernier eb8bd92a0b Updating telemetry link 2021-12-20 10:25:30 -05:00
..
assets Removing unnecessary office product from the sample metadata 2021-12-10 19:55:32 +02:00
config Update readme 2021-09-26 21:54:22 +07:00
src Update spfx version 2021-09-26 21:18:50 +07:00
teams Update spfx version 2021-09-26 21:18:50 +07:00
.editorconfig Added SharePoint CRUD sample (#16) 2016-09-16 06:33:47 +02:00
.gitattributes Added SharePoint CRUD sample (#16) 2016-09-16 06:33:47 +02:00
.gitignore Update spfx version 2021-09-26 21:18:50 +07:00
.npmignore Updated SharePoint CRUD sample to SPFx GA (#147) 2017-03-09 15:03:19 +02:00
.yo-rc.json Update spfx version 2021-09-26 21:18:50 +07:00
README.md Updating telemetry link 2021-12-20 10:25:30 -05:00
gulpfile.js Update spfx version 2021-09-26 21:18:50 +07:00
package-lock.json Updated readme and sample.json 2021-10-29 11:40:33 -04:00
package.json Update version 2021-09-26 22:08:18 +07:00
tsconfig.json Update spfx version 2021-09-26 21:18:50 +07:00
tslint.json Update spfx version 2021-09-26 21:18:50 +07:00

README.md

page_type products languages extensions
sample
office-sp
javascript
typescript
contentType technologies platforms createdDate
samples
SharePoint Framework
JQuery
Knockout
React
1/1/2016 12:00:00 AM

SharePoint CRUD operations

Summary

Sample Web Parts illustrating performing SharePoint CRUD operations in React, Angular, JavaScript without any framework and using the @pnp/sp library.

Sample To do SharePoint Framework Client-Side Web Part built using Angular and ngOfficeUIFabric

Compatibility

SPFx 1.12.1 Node.js v14 | v12 | v10 SharePoint Online Teams N/A: Untested with Microsoft Teams Workbench Hosted

Applies to

Solution

Solution Author(s)
sharepoint-crud Waldek Mastykarz (MVP, Rencore, @waldekm)
sharepoint-crud Gautam Sheth (SharePoint Consultant, RapidCircle)
sharepoint-crud Ari Gunawan (@AriGunawan3023)

Version history

Version Date Comments
1.4 September 26, 2021 Updated to SPFx 1.12.1
1.3 November 1, 2018 Updated to SPFx 1.6.0
1.2 March 30, 2018 Updated to SPFx 1.4.1
1.1 March 9, 2017 Updated to SPFx GA
1.0 September 16, 2016 Initial release

Prerequisites

Minimal Path to Awesome

  • clone this repo
  • in the command line run:
    • npm i
    • gulp serve --nobrowser
  • in your SharePoint Site create a list

Note: this Site should be located in a Site Collection under the /sites/ managed path, eg. https://contoso.sharepoint.com/sites/my-team-site

Features

This project contains sample client-side web parts built on the SharePoint Framework illustrating how to perform SharePoint CRUD operations on different JavaScript frameworks.

This sample illustrates the following concepts on top of the SharePoint Framework:

  • general
    • performing SharePoint CRUD operations
      • in React
      • in Angular v1.x
      • without a particular JavaScript framework
      • using the @pnp/sp library
    • using ETag to ensure data integrity when updating and deleting items
    • chaining promises for performing multiple asynchronous operations as part of one use case
    • breaking a chain of promises in case of an error and handling it gracefully
    • retrieving List Item Entity Type for modelling items in REST requests
    • optimizing REST responses for performance
  • React
    • using Office UI Fabric React components
    • using state to keep track of Web Part status and data
    • using Web Part's HttpClient in a React component
  • Angular
    • loading Angular and ngOfficeUIFabric from CDN
    • using conditional rendering for one-time Web Part setup
    • passing Web Part configuration to Angular and reacting to configuration changes in the Angular application
  • @pnp/sp library
    • using the @pnp/sp JS library with SharePoint Framework Client-Side Web Parts
    • configuring global request headers and overriding them for specific requests
    • sorting and selecting top n items from a list using the fluent API

Help

We do not support samples, but we this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you're having issues building the solution, please run spfx doctor from within the solution folder to diagnose incompatibility issues with your environment.

If you encounter any issues while using this sample, create a new issue.

For questions regarding this sample, create a new question.

Finally, if you have an idea for improvement, make a suggestion.

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.