|
| 1 | +# ListItemComments control |
| 2 | + |
| 3 | +This control allows you to manage list item comments, you can add or delete comments to an item. The comments are listed in tile view. |
| 4 | +user can scroll to load more comments if they exist (infinite scroll); |
| 5 | + |
| 6 | + |
| 7 | +Here is an example of the control: |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## How to use this control in your solutions |
| 20 | + |
| 21 | +- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency. |
| 22 | +- Import the control into your component: |
| 23 | + |
| 24 | +```TypeScript |
| 25 | +import { ListItemComments } from '@pnp/spfx-controls-react/lib/ListItemComments'; |
| 26 | +``` |
| 27 | +- Use the `ListItemComments` control in your code as follows: |
| 28 | + |
| 29 | +```TypeScript |
| 30 | +<ListItemComments webUrl='{"https://contoso.sharepoint.com/sites/ThePerspective"}' |
| 31 | + listId='dfa283f4-5faf-4d54-b6b8-5bcaf2725af5' |
| 32 | + itemId={1} |
| 33 | + serviceScope={serviceScope} |
| 34 | + numberCommentsPerPage={10} |
| 35 | + label="ListItem Comments" |
| 36 | + /> |
| 37 | +``` |
| 38 | + |
| 39 | + |
| 40 | +## Implementation |
| 41 | + |
| 42 | +The `ListItemComments` control can be configured with the following properties: |
| 43 | + |
| 44 | + |
| 45 | +| Property | Type | Required | Description | |
| 46 | +| ---- | ---- | ---- | ---- | |
| 47 | +| serviceScope | ServiceScope | yes | SPFx Service Scope | |
| 48 | +| itemId | number | yes | List Item Id | |
| 49 | +| listId | string | yes | Guid of the list. | |
| 50 | +| webUrl | string | no | URL of the site. By default it uses the current site URL. | |
| 51 | +| label | string | no | Label for control | |
| 52 | +| numberCommentsPerPage | number | no | number of comments per page possible values 5 | 10 | 15 | 20 default 10 | |
| 53 | + |
| 54 | +## MSGraph Permissions required |
| 55 | + |
| 56 | +This control required the flowing scopes: |
| 57 | +at least : People.Read |
| 58 | + |
| 59 | + |
0 commit comments