-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
MudTable: Add ability to control which rows are editable #8873
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #8873 +/- ##
==========================================
+ Coverage 89.82% 90.24% +0.41%
==========================================
Files 412 425 +13
Lines 11878 12292 +414
Branches 2364 2409 +45
==========================================
+ Hits 10670 11093 +423
+ Misses 681 668 -13
- Partials 527 531 +4 ☔ View full report in Codecov by Sentry. |
c2b68fe
to
c426233
Compare
src/MudBlazor.UnitTests.Viewer/MudBlazor.UnitTests.Viewer.csproj
Outdated
Show resolved
Hide resolved
@@ -114,6 +114,8 @@ private EventCallback<MouseEventArgs> RowMouseLeaveEventCallback | |||
|
|||
private void StartEditingItem(bool buttonClicked) | |||
{ | |||
if (!IsEditable) return; |
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.
@henon doesn't seems like your statement is correct #7787 (comment)
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.
Yes, I was mistaken, the rename will be done via #8892 which is not yet merged.
c426233
to
493d7e1
Compare
Thanks @biegehydra |
Reopened #7787 because that PR became a mess
Description
It would be useful to have control over which items are editable on a per row basis. Often times there are certain records that you don't want to allow to be edited. This PR lets you provide a
Func<T, bool>
to control which items are editable.This is accomplished by treating
IsEditable
on theMudTr
andIsEditable
on theMudTable
as separate values where previously they were essentially the same.Here's a quick example where editing is only allowed when the temperature is greater than 20.
2023-11-20.01-43-30.mp4
How Has This Been Tested?
Types of changes
I don't really think this is a breaking change, but I am sure there is some edge case that is affected by this change.
Checklist:
dev
).