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

how to refresh data in reactjs with typescript? #170

Open
SunnyXiao opened this issue Sep 16, 2019 · 0 comments
Open

how to refresh data in reactjs with typescript? #170

SunnyXiao opened this issue Sep 16, 2019 · 0 comments

Comments

@SunnyXiao
Copy link

SunnyXiao commented Sep 16, 2019

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


}
}

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

No branches or pull requests

1 participant