MudTable: Add row disabled#12441
Merged
danielchalmers merged 17 commits intoMudBlazor:devfrom Jan 31, 2026
Merged
Conversation
Contributor
Author
|
@danielchalmers Does copilot have a stroke or do I? His comments don't really make sense do they? |
Member
Copilot has been messing up a LOT the last 24 hrs. Ignore for now, sorry! |
Member
|
Conflicts after merging #12447 |
# Conflicts: # src/MudBlazor.Docs/Pages/Components/Table/Examples/TableRowClassFuncExample.razor # src/MudBlazor.Docs/Pages/Components/Table/TablePage.razor
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/MudBlazor.Docs/Pages/Components/Table/Examples/TableBasicExample.razor
Show resolved
Hide resolved
src/MudBlazor.Docs/Pages/Components/Table/Examples/TableRowClassFuncExample.razor
Outdated
Show resolved
Hide resolved
Comment on lines
+92
to
+116
| /// <summary> | ||
| /// The function which determines if a row is disabled. | ||
| /// A disabled row ignores mouse events and uses <c>--mud-palette-text-disabled</c> as color. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Make the function return <c>true</c> to diable the corresponding row. When no value is set, all rows are considered enabled. | ||
| /// </remarks> | ||
| [Parameter] | ||
| [Category(CategoryTypes.Table.Behavior)] | ||
| public Func<T, bool>? RowDisabledFunc { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The class to use for disabled rows. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Defaults to <c>mud-table-row-disabled</c> | ||
| /// </remarks> | ||
| [Parameter] | ||
| [Category(CategoryTypes.Table.Appearance)] | ||
| public string DisabledRowClass { get; set; } = "mud-table-row-disabled"; | ||
|
|
||
| private bool IsRowDisabled(T item) | ||
| { | ||
| return RowDisabledFunc != null && RowDisabledFunc(item); | ||
| } |
There was a problem hiding this comment.
The new RowDisabledFunc feature lacks test coverage. Consider adding unit tests to verify that:
- Disabled rows apply the correct CSS class
- Disabled rows don't respond to click events
- Disabled rows can't be selected when MultiSelection is enabled
- The
IsRowDisabledmethod correctly evaluates the function - The
DisabledRowClassparameter can be customized
# Conflicts: # src/MudBlazor/Components/Table/MudTable.razor
Member
|
lgtm |
This was referenced Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
RowDisabledFuncto theMudTablewhich allows to disable rows based on a condition. Real world usage would be for example a list of items I display in my user facing app of which some are currently hidden for the user.This PR also adds
cursor: pointerto tables withhoverenabled to indicate to a user that this table is interactive. In addition, some minor code touchups were made.