-
Notifications
You must be signed in to change notification settings - Fork 253
Description
hello, i used grid in reactjs with typescript, when i change dataModel, the grid is not refresh;
and how to solved? my code is following:
"pqgrid": "^6.2.4",
"typescript": "^3.1.6",
"react": "^16.9.0",
grid.tsx:
export default class Pqgrid extends React.Component<any, {}>{
componentDidMount() {
//@ts-ignore
this.options = this.props.options;
//@ts-ignore
this.grid = pq.grid(this.refs.grid, this.options);
//@ts-ignore
console.log('render grid', this.grid)
}
componentDidUpdate(prevProps) {
//@ts-ignore
console.log('this.options:', this.options)
//@ts-ignore
Object.assign(this.options, this.props.options);
//@ts-ignore
this.grid.option("colModel", this.options.colModel)
//@ts-ignore
this.grid.option("dataModel", this.options.dataModel)
//@ts-ignore
this.grid.refreshDataAndView();
}
render() {
return
}
}