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

[RFR] Added isRowSelectable function prop to Datagrid component. #3964

Merged
merged 4 commits into from Nov 27, 2019

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented Nov 9, 2019

DatagridRow components of a <Datagrid/> will show a checkbox if isRowSelectable prop returns true.
Solves the select all problem described here: #3470 (comment).

<Datagrid
    {...props}
    isRowSelectable={ record => record.id > 300 } 
>
...
</Datagrid>

chrome-capturee

@WiXSL WiXSL changed the title [RFR] Added isSelectable function prop to DatagridRow component [RFR] Added selectableRows function prop to DatagridRow component. Nov 9, 2019
@WiXSL WiXSL changed the title [RFR] Added selectableRows function prop to DatagridRow component. [RFR] Added selectableRows function prop to Datagrid component. Nov 9, 2019
@djhi djhi added this to the 3.1.0 milestone Nov 10, 2019
Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Thanks for working on this :) We'll have to measure the performance impact though.

packages/ra-ui-materialui/src/list/Datagrid.js Outdated Show resolved Hide resolved
@WiXSL WiXSL changed the title [RFR] Added selectableRows function prop to Datagrid component. [RFR] Added canSelectRow function prop to Datagrid component. Nov 10, 2019
@WiXSL WiXSL requested a review from djhi November 10, 2019 12:35
@WiXSL
Copy link
Contributor Author

WiXSL commented Nov 10, 2019

I'm open to suggestions.

@WiXSL WiXSL force-pushed the datagridrow-isselectable-prop branch from d4b3241 to 1849c33 Compare November 25, 2019 03:24
@WiXSL
Copy link
Contributor Author

WiXSL commented Nov 26, 2019

@djhi did you have time to see this?

@djhi
Copy link
Contributor

djhi commented Nov 27, 2019

No but I have some time today so I will :)

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Looks pretty good 👍

@fzaninotto fzaninotto merged commit f2b6e12 into marmelab:next Nov 27, 2019
@fzaninotto
Copy link
Member

Thanks!

@WiXSL WiXSL deleted the datagridrow-isselectable-prop branch November 27, 2019 14:49
@WiXSL WiXSL changed the title [RFR] Added canSelectRow function prop to Datagrid component. [RFR] Added isRowSelectable function prop to Datagrid component. Dec 4, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants