Skip to content

Commit 04a556c

Browse files
Merge pull request #1659 from stevebeauge/fix/1379-improve-folder-picker-documentation
Improve documentation of FolderPicker
2 parents 8766cc3 + 63e9c64 commit 04a556c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/documentation/docs/controls/FolderPicker.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ private _onFolderSelect = (folder: IFolder): void => {
5050
}
5151
```
5252

53+
- If you want to pick a folder outside the current site collection (not the one targeted by the SPFx context), you have to specify which site collection owns the folder. You can do this by setting the `siteAbsoluteUrl` property to the URL of the site collection that owns the folder.
54+
55+
```TypeScript
56+
<FolderPicker context={this.props.context}
57+
label='Folder Picker'
58+
rootFolder={{
59+
Name: 'Documents',
60+
ServerRelativeUrl: '/sites/anotherSite/Shared Documents'
61+
}}
62+
siteAbsoluteUrl="https://contoso.sharepoint.com/sites/anotherSite"
63+
onSelect={this._onFolderSelect} />
64+
```
65+
5366
## Implementation
5467

5568
The `FolderPicker` control can be configured with the following properties:
@@ -59,6 +72,7 @@ The `FolderPicker` control can be configured with the following properties:
5972
| context | BaseComponentContext | yes | The context object of the SPFx loaded webpart or customizer. |
6073
| label | string | yes | The label for the control. |
6174
| rootFolder | IFolder | yes | The lowest level folder that can be explored. This can be the root folder of a library. |
75+
| siteAbsoluteUrl | string | no | The absolute url of the target site. Only required if rootFolder does not belongs to the current site |
6276
| defaultFolder | IFolder | no | The default folder to be selected or explored. |
6377
| required | boolean | no | Is selection required. |
6478
| disabled | boolean | no | Is the control disabled. |

0 commit comments

Comments
 (0)