doc(Table): update fix column sample code#8057
Conversation
…mn该属性自动为true feat(Table): 当表格ShowLineNo属性为true,且表格中有列属性Fixed为true时,FixedLineNoColumn该属性自动为true
|
Thanks for your PR, @Tony-ST0754. 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 updates the Table component so that when row numbers are shown and any data column is fixed, the LineNo column automatically becomes fixed (including after state persistence), and clarifies related property documentation. Sequence diagram for automatic LineNo column fixing in Table renderingsequenceDiagram
participant BlazorRenderer
participant Table as TableComponent
participant Column as TableColumn
BlazorRenderer->>Table: RenderContentRow(item)
loop ForEachVisibleColumn
Table->>Column: Access Fixed
alt ShowLineNo && Column.Fixed && !FixedLineNoColumn
Table->>Table: FixedLineNoColumn = Column.Fixed
Table->>Table: StateHasChanged()
end
Table->>BlazorRenderer: RenderContentCell(context)
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The logic that sets
FixedLineNoColumnand callsStateHasChanged()insideRenderContentRowintroduces side effects during rendering and risks unnecessary re-renders or render loops; consider computing this once (e.g., inOnParametersSet/OnAfterRender) based on the column metadata instead of mutating state from within the cell render loop. FixedLineNoColumnis a[Parameter]but is being mutated inside the component; if consumers can set this parameter explicitly, it would be clearer either to treat it as internal state (with a backing field) or to introduce a separate internal flag so the component does not overwrite a value controlled by the parent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The logic that sets `FixedLineNoColumn` and calls `StateHasChanged()` inside `RenderContentRow` introduces side effects during rendering and risks unnecessary re-renders or render loops; consider computing this once (e.g., in `OnParametersSet`/`OnAfterRender`) based on the column metadata instead of mutating state from within the cell render loop.
- `FixedLineNoColumn` is a `[Parameter]` but is being mutated inside the component; if consumers can set this parameter explicitly, it would be clearer either to treat it as internal state (with a backing field) or to introduce a separate internal flag so the component does not overwrite a value controlled by the parent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8057 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 766 766
Lines 34155 34155
Branches 4697 4697
=========================================
Hits 34155 34155
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:
|
feat(Table): 当表格ShowLineNo属性为true,且表格中有列属性Fixed为true时,FixedLineNoColumn该属性自动为true
Link issues
fixes #8056
问题描述 / Problem Description
doc(Table): update fix column sample code
影响范围 / Impact
对老用户无影响
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Automatically fix the table line-number column when other columns are fixed and clarify related persisted state behavior.
New Features:
Enhancements: