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

v0.11 - [Table] If selected key for some rows gets changed ensure table internal selection array gets updated #1325

Merged
merged 3 commits into from
Aug 13, 2015

Conversation

hiddentao
Copy link
Contributor

Same as #1282 but for v0.11 branch.

};
},

componentWillReceiveProps(nextProps) {
if (this.props.allRowsSelected && !nextProps.allRowsSelected) {
if (nextProps.rowData !== this.props.rowData) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could get tricky. The new table implementation does not use rowData; it relies on children. We'll need to check the children for changes instead of rowData which could get quite expensive if we are doing this check every time the component receives props.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I went through that a bit quickly. Will fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries; other changes look good. We might want to check the table for performance metrics; recreating a lot of components can get quite expensive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now fixed this issue. From my testing I can say I don't think performance will be an issue except for very large tables.

hai-cea pushed a commit that referenced this pull request Aug 13, 2015
v0.11 - [Table] If `selected` key for some rows gets changed ensure table internal selection array gets updated
@hai-cea hai-cea merged commit 534b23d into mui:v0.11 Aug 13, 2015
@hai-cea
Copy link
Member

hai-cea commented Aug 13, 2015

Thanks @hiddentao @jkruder

@hai-cea hai-cea mentioned this pull request Aug 13, 2015
@zannager zannager added the component: table This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants