-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(Table): update auto-fit column width callback to include width #6868
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
Modified the OnAutoFitContentAsync callback to accept the calculated column width as a parameter in both C# and JavaScript. This allows custom logic to consider the current width when determining the final column width, improving flexibility for auto-fit scenarios. Co-Authored-By: ljmay168 <[email protected]>
|
Thanks for your PR, @AApuci. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR refines the auto-fit column width workflow by first measuring the raw maximum cell width in JavaScript, then passing that value into the C# callback for custom adjustment; it also fixes row selection to include header rows per issue #6864. Sequence diagram for updated auto-fit column width workflowsequenceDiagram
participant JS as JavaScript (Table.razor.js)
participant CSharp as C# (Table.razor.cs)
participant Callback as OnAutoFitContentAsync
JS->>JS: Calculate maxWidth from table cells
JS->>CSharp: invokeMethodAsync(AutoFitContentCallback, fieldName, maxWidth)
CSharp->>Callback: OnAutoFitContentAsync(fieldName, maxWidth)
Callback-->>CSharp: widthValue
CSharp-->>JS: widthValue
JS->>JS: Use widthValue if > 0, else use maxWidth
Class diagram for updated Table component auto-fit callbackclassDiagram
class Table {
+Func<string, float, Task<float>>? OnAutoFitContentAsync
+Task<float> AutoFitContentCallback(string fieldName, float calcWidth)
}
Table : AutoFitContentCallback is JSInvokable
Table --> "OnAutoFitContentAsync" Func<string, float, Task<float>>
File-Level Changesrows alongside cells
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Modified the UnitTest
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6868 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 739 739
Lines 31763 31763
Branches 4466 4466
=========================================
Hits 31763 31763
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
修改 单元测试宽度计算 Signed-off-by: AApuci <[email protected]>
|
@AApuci 按照提示签署一下 CLA 谢谢啦 |
|
@dotnet-policy-service agree |
|
@microsoft-github-policy-service agree |
Modified the OnAutoFitContentAsync callback to accept the calculated column width as a parameter in both C# and JavaScript. This allows custom logic to consider the current width when determining the final column width, improving flexibility for auto-fit scenarios.
Link issues
fixes #6863
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enhance the auto-fit column width feature by passing the calculated width into the user callback and refining the width computation logic in JavaScript.
Enhancements: