Skip to content

Commit 37c2f27

Browse files
committed
Merge branch 'joaojmendes-dev' into dev
2 parents 97818fc + 1d9753c commit 37c2f27

28 files changed

+971
-11
lines changed
51.6 KB
Loading
55.3 KB
Loading
51.9 KB
Loading
50.1 KB
Loading
24.4 KB
Loading
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
![ListItemAttachments Upload](../assets/ListItemAttachmentsUpload.png)
8+
9+
![ListItemAttachments Tiles](../assets/ListItemAttachmentsTitles.png)
10+
11+
![ListItemAttachments Confirm Delete](../assets/ListItemAttachmentDeleteConfirm.png)
12+
13+
![ListItemAttachments Attachment Deleted ](../assets/ListItemAttachementDeletedMsg.png)
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+
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/ListItemAttachments)

docs/documentation/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ nav:
1313
- "Radar Chart": 'controls/charts/RadarChart.md'
1414
- "Scatter Chart": 'controls/charts/ScatterChart.md'
1515
- FileTypeIcon: 'controls/FileTypeIcon.md'
16+
- ListItemAttachments: 'controls/ListItemAttachments.md'
1617
- ListItemPicker: 'controls/ListItemPicker.md'
1718
- ListPicker: 'controls/ListPicker.md'
1819
- ListView: 'controls/ListView.md'

src/ListItemAttachments.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './controls/listItemAttachments';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface IListItemAttachmentFile{
2+
FileName : string;
3+
ServerRelativeUrl: string;
4+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { WebPartContext } from "@microsoft/sp-webpart-base";
2+
import { ApplicationCustomizerContext } from "@microsoft/sp-application-base";
3+
4+
export interface IListItemAttachmentsProps {
5+
listId: string;
6+
itemId: number;
7+
className?: string;
8+
webUrl?:string;
9+
disabled?: boolean;
10+
context: WebPartContext | ApplicationCustomizerContext;
11+
}

0 commit comments

Comments
 (0)