Rerender paginated list on collection update
Rerender paginated list on collection update
This commit is contained in:
parent
6acf4addf4
commit
9572960ff6
|
@ -126,7 +126,8 @@ export default class HeroWebpartWebPart extends BaseClientSideWebPart<IHeroWebpa
|
|||
hideLinkUploadTab: true
|
||||
})
|
||||
);
|
||||
}
|
||||
},
|
||||
required: true
|
||||
}
|
||||
],
|
||||
disabled: false
|
||||
|
|
|
@ -70,11 +70,14 @@ export default class HeroWebpart extends React.Component<IHeroWebpartProps, IHer
|
|||
|
||||
public componentDidUpdate(prevProps : IHeroWebpartProps, prevState : IHeroState) : void
|
||||
{
|
||||
// If properties have changed bind it and update webpart
|
||||
if(this.props.items !== prevProps.items || this.state.items !== prevState.items)
|
||||
{
|
||||
this.setState({items:this.props.items});
|
||||
}
|
||||
// If properties have changed bind it and update webpart
|
||||
if(this.props.items !== prevProps.items || this.state.items !== prevState.items)
|
||||
{
|
||||
this.setState({items:this.props.items});
|
||||
if(this.props.showAllHero){
|
||||
this._getPage(this.state.currentPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public render(): React.ReactElement<IHeroWebpartProps> {
|
||||
|
|
Loading…
Reference in New Issue