-
Notifications
You must be signed in to change notification settings - Fork 2
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
β¨(react) make optional DataGrid row selection #339
base: main
Are you sure you want to change the base?
Conversation
π¦ Changeset detectedLatest commit: 60d17e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
e2adb7d
to
486f028
Compare
When using the selection feature on another project we realized that we needed to make some row non selectable at all by hiding the checkbox completely.
486f028
to
60d17e3
Compare
return ( | ||
<Checkbox | ||
checked={row.getIsSelected()} | ||
disabled={!row.getCanSelect} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your change highlights this logic is wrong
disabled={!row.getCanSelect} | |
disabled={!row.getCanSelect()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right on this, but we need a way to hide checkboxes, not just grey them out. WDYT about adding a props on DataGrid named hideSelectCellWhenDisabled
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(ping) :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops! I did not our reply ...
Ok let's do that
@@ -70,6 +70,10 @@ below the table. | |||
|
|||
<Canvas sourceState="shown" of={Stories.ClientSideWithPagination}/> | |||
|
|||
You can also make a row non selectable by setting using `enableRowSelection` as a callback function that returns a boolean based on a condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also make a row non selectable by setting using `enableRowSelection` as a callback function that returns a boolean based on a condition. | |
You can also make a row non selectable by setting `enableRowSelection` prop with a callback function that returns a boolean based on a condition. |
Hi there π
When using the selection feature on another project we realized that we needed to make some row non selectable at all by hiding the checkbox completely.
Result
Use case
We are building a file explorer in which we want to allow users to select files but not the folders, see: