-
-
Notifications
You must be signed in to change notification settings - Fork 381
feat(Table): add SetRowStyleFormatter parameter #7758
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,13 @@ public partial class Table<TItem> | |
| [Parameter] | ||
| public Func<TItem, string?>? SetRowClassFormatter { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">获得/设置 行样式格式回调委托</para> | ||
|
||
| /// <para lang="en">Gets or sets Row Style Formatter Callback</para> | ||
| /// </summary> | ||
| [Parameter] | ||
| public Func<TItem, string?>? SetRowStyleFormatter { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">获得/设置 取消保存后回调委托方法</para> | ||
| /// <para lang="en">Gets or sets After Cancel Save Callback</para> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,14 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where | |
| .AddClass("is-edit", EditInCell) | ||
| .Build(); | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">获得 Body 内行内联样式</para> | ||
| /// <para lang="en">Get Body Row Inline Style</para> | ||
| /// </summary> | ||
| protected string? GetRowStyleString(TItem item) => CssBuilder.Default() | ||
| .AddClass(SetRowStyleFormatter?.Invoke(item)) | ||
| .Build(); | ||
|
Comment on lines
+136
to
+142
|
||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">明细行首小图标单元格样式</para> | ||
| /// <para lang="en">Detail Row Icon Cell CSS Class</para> | ||
|
|
||
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.
There is a trailing whitespace at the end of the
style="@GetRowStyleString(item)"attribute line. While this is not functionally harmful, it's a minor style issue and the codebase should ideally be free of unnecessary trailing whitespace.