|
| 1 | +# ListItemAttachments control |
| 2 | + |
| 3 | +This control allows you to manage list item attachments, you can add or delete associated attachments. The attachments are listed in tile view. |
| 4 | + |
| 5 | +Here is an example of the control: |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## How to use this control in your solutions |
| 16 | + |
| 17 | +- 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. |
| 18 | +- Import the control into your component: |
| 19 | + |
| 20 | +```TypeScript |
| 21 | +import { ListItemAttachments } from '@pnp/spfx-controls-react/listItemAttachments'; |
| 22 | +``` |
| 23 | +- Use the `ListItemAttachments` control in your code as follows: |
| 24 | + |
| 25 | +```TypeScript |
| 26 | +<ListItemAttachments listId='dfa283f4-5faf-4d54-b6b8-5bcaf2725af5' |
| 27 | + itemId={1} |
| 28 | + context={this.props.context} |
| 29 | + disabled={false} /> |
| 30 | +``` |
| 31 | + |
| 32 | +## Implementation |
| 33 | + |
| 34 | +The `ListItemAttachments` control can be configured with the following properties: |
| 35 | + |
| 36 | + |
| 37 | +| Property | Type | Required | Description | |
| 38 | +| ---- | ---- | ---- | ---- | |
| 39 | +| context | WebPartContext \| ApplicationCustomizerContext | yes | SPFx web part or extention context | |
| 40 | +| itemId | number | yes | List Item Id | |
| 41 | +| listId | string | yes | Guid of the list. | |
| 42 | +| webUrl | string | no | URL of the site. By default it uses the current site URL. | |
| 43 | +| disabled | boolean | no | Specifies if the control is disabled or not. | |
| 44 | + |
| 45 | + |
0 commit comments