Skip to content

Commit 9e83584

Browse files
committed
add refreshtoggle to listpicker
1 parent dc35093 commit 9e83584

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

docs/documentation/docs/controls/ListPicker.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ The `ListPicker` control can be configured with the following properties:
6565
| onSelectionChanged | (newValue: string OR string[]): void | no | Callback function when the selected option changes. |
6666
| webAbsoulteUrl | string | no | Absolute Web Url of target site (user requires permissions) |
6767
| contentTypeId | string | no | The Id if a content type which must be present in a list in order for the list to appear in the picker.|
68+
| refreshToggle | boolean | no | If present can be used to force the control to refresh the list of lists by toggling its value|
69+
6870
Enum `LibsOrderBy`
6971

7072
| Value |

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controls/listPicker/IListPicker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export interface IListPickerProps {
6464
* Content type id which, if present, must be on the list
6565
*/
6666
contentTypeId?: string;
67+
/**
68+
* if present can be used to force the control to refresh the list of lists by toggling its value
69+
*/
70+
refreshToggle?: boolean;
6771
}
6872

6973
export interface IListPickerState {

src/controls/listPicker/ListPicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export class ListPicker extends React.Component<IListPickerProps, IListPickerSta
5151
prevProps.baseTemplate !== this.props.baseTemplate ||
5252
prevProps.includeHidden !== this.props.includeHidden ||
5353
prevProps.orderBy !== this.props.orderBy ||
54-
prevProps.webAbsoluteUrl !== this.props.webAbsoluteUrl
54+
prevProps.webAbsoluteUrl !== this.props.webAbsoluteUrl||
55+
prevProps.refreshToggle !== this.props.refreshToggle
5556
) {
5657
this.loadLists();
5758
}

0 commit comments

Comments
 (0)