-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Pass through arbitrary attributes to QuickGrid #48268
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
Conversation
Thanks for your PR, @ElderJames. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Thanks @ElderJames! This is looking really good. One small issue will arise with this implementation, though. The grid already generates a To solve this, I would suggest:
This would preserve existing behaviors while also letting the developer add extra classes using a normal |
Thanks for your suggestions @SteveSandersonMS , I have fixed this. But I'm a little confused about the test and why the |
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
Hello @SteveSandersonMS , could you please teach me how to solve the style attribute issue? |
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.
Thanks for your PR.
Glad to see updated tests too. There is just one minor optimization I've left a comment about and then I think this will be in good shape to take.
if (AdditionalAttributes?.TryGetValue("class", out var originalClass) == true) | ||
{ | ||
gridClass += $" {originalClass}"; | ||
} |
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 utilize the AttributeUtilities.CombineClassNames method instead:
public static string? CombineClassNames(IReadOnlyDictionary<string, object>? additionalAttributes, string? classNames) |
Here is a usage example in the CssClass
property of the InputBase
type;
protected string CssClass |
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.
Thank you @mkArtakMSFT , I have done the changes, but AttributeUtilities.CombineClassNames is internal that can't be accessed in QuickGrid library. How to solve that?
Thanks for the update. This is now ready to merge, except for fixing the final compiler issue. We need it to go in today, so I've made the necessary change and am continuing the PR in #50051, so will close this PR in favour of that. The new PR still uses the original commits from here so hopefully @ElderJames will still be credited as the author. |
Pass through arbitrary attributes to QuickGrid
Summary of the changes (Less than 80 chars)
Add the
AdditionalAttributes
parameter withCaptureUnmatchedValues
flag and pass through to QuickGrid table element.Description
Follow up aspnet/AspLabs#559 (comment)
Fixes #45327