Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for ViewPicker control - Issue 1439 #1519

Closed
wants to merge 1 commit into from
Closed

Update documentation for ViewPicker control - Issue 1439 #1519

wants to merge 1 commit into from

Conversation

NishkalankBezawada
Copy link
Contributor

Q A
Bug fix? [ ]
New feature? [x]
New sample? [ ]
Related issues? fixes #1439

What's in this Pull Request?

Added a new control 'ViewPicker' which enables to select the list views just like ListPicker, SitePicker, FieldPicker controls

Properties used

Property What is it used for?
context (Mandatory) Context of the current web part
className (Not mandatory) If provided, additional class name to provide on the dropdown element.
deferredValidationTime (Not mandatory) Custom Field will start to validate after users stop typing for deferredValidationTime milliseconds. Default value is 200.
disabled (Not mandatory) Whether the property pane field is enabled or not.
filter (Not Mandatory) Filter views from Odata query
label (mandatory) Property field label displayed on top
listId (Not mandatory) The List Id of the list where you want to get the views.
placeholder (Not mandatory) Input placeholder text. Displayed until option is selected.
orderBy (Not mandatory) Specify the property on which you want to order the retrieve set of views. orderBy viewId and by title
selectedView (Not Mandatory) Initial selected view of the control.
showBlankOption (mandatory) Whether or not to show a blank option. Default false.
viewsToExclude (Not mandatory) Defines view titles which should be excluded from the view picker control.
webAbsoluteUrl (Not mandatory) Absolute Web Url of target site (user requires permissions).
onViewPickerPropertyChange (Mandatory) Defines a change function to raise when the selected value changed.
onViewsRetrieved (Not mandatory) Callback that is called before the dropdown is populated.

Screens

Below is the implementation of the control

    <ViewPicker context={this.props.context}
        label="Select view(s)"
        listId={"9f3908cd-1e88-4ab3-ac42-08efbbd64ec9"}
        placeholder={'Select list view(s)'}
        orderBy={2}
        onViewPickerPropertyChange={this.onViewPickerChange.bind(this)} />

image

  • The onViewPickerPropertyChange change event returns the selected view(s) and can be implemented as follows:
private onViewPickerChange = (newValue: string | string[]) => {
    console.log("newView:", newValue);
}

Below is the screen of the control from workbench

image

Below are the sample screen of the list views.

image

Below are the views which are fetched in the control

image

//Nishkalank Bezawada

@NishkalankBezawada
Copy link
Contributor Author

Hello @AJIXuMuK ,

This is the update for the PR - 1505.

Kindly review and comment.

Thanks,
Nishkalank

@AJIXuMuK
Copy link
Collaborator

@NishkalankBezawada - thank you for that.
There are conflicts as the previous PR has been reverted.
Could you please include all missing parts/fix conflicts?

Also, the comments seem to be addressed incompletely.
For example, I asked to change onPropertyChange to onChange. However, in the new PR I'm seeing onViewPickerPropertyChange.

Could you please reiterate on the comments from the previous PR?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants