-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Right way to forceUpdate on Cell? #596
Comments
Best way is to create a custom cell renderer class, which you then pass as prop in your custom row renderer class CustomCellRenderer extends React.Component {
render() {
return <ReactDataGrid.Cell {...publicProps} forceUpdate={true}/>
}
CustomRowFormatter extends React.Component {
render (){
return <ReactDataGrid.Row {...this.props} forceUpdate={true} cellRenderer= {CustomCellRenderer}/>;
} |
Thanks for the info, one other question, Is there a way to pass an object/property/whatever from ReactDataGrid to Row or Cell? For example
I guess I can modify the rows object and insert something into each row object but it seems like it would be fairly hacky to do so. |
Also, class CustomCellRenderer extends React.Component {
render() {
return <ReactDataGrid.Cell {...publicProps} forceUpdate={true}/>
} needs to have setScrollLeft defined if using the freezing columns functionality, I get an error thrown that setScrollLeft is not defined when trying to define my own CellRenderer in the Row object. |
Let's keep this kind of questions to Stack Overflow like it is requested in here |
Hi guys
I was curious as to the right way to forceUpdate on a Cell?
The way I've found out so far is to add a callback to ReactDataGrid.Row's cellRenderer
IE
}
However, I keep seeing errors in regards to refs to the Cells
warning.js:36 Warning: Stateless function components cannot be given refs (See ref "foo" in bound handleCellRender created by Row). Attempts to access this ref will fail.
Is there a better way to forceUpdate on a cell?
The text was updated successfully, but these errors were encountered: