Skip to content

Commit eb48854

Browse files
committed
doc: 增加行合并示例
1 parent 11f0605 commit eb48854

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

src/BootstrapBlazor.Server/Components/Samples/Table/TablesRow.razor

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,25 @@
146146
<DemoBlock Title="@Localizer["RowTemplateTitle"]"
147147
Introduction="@Localizer["RowTemplateIntro"]"
148148
Name="RowTemplate">
149-
<section ignore>@((MarkupString)Localizer["RowTemplateDesc"].Value)</section>
149+
<Table TItem="Foo" IsPagination="true" PageItemsSource="@PageItemsSource" class="table-row-template"
150+
IsStriped="true" IsBordered="true"
151+
OnQueryAsync="@OnQueryAsync">
152+
<TableColumns>
153+
<TableColumn @bind-Field="@context.DateTime" Width="180" />
154+
<TableColumn @bind-Field="@context.Name" Width="100" />
155+
<TableColumn @bind-Field="@context.Address" />
156+
<TableColumn @bind-Field="@context.Count" />
157+
</TableColumns>
158+
<RowTemplate>
159+
<MergeTableRow Context="@context"></MergeTableRow>
160+
</RowTemplate>
161+
</Table>
162+
</DemoBlock>
163+
164+
<DemoBlock Title="@Localizer["RowContentTemplateTitle"]"
165+
Introduction="@Localizer["RowContentTemplateIntro"]"
166+
Name="RowContentTemplate">
167+
<section ignore>@((MarkupString)Localizer["RowContentTemplateDesc"].Value)</section>
150168

151169
<Table TItem="Foo" IsPagination="true" PageItemsSource="@PageItemsSource" class="table-row-template"
152170
IsStriped="true" IsBordered="true"

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5528,9 +5528,11 @@
55285528
"ClickToSelectP3": "Currently selected row:",
55295529
"ClickToSelectNoneText": "None",
55305530
"PlaceHolder": "Cannot be empty, within 50 characters",
5531+
"RowContentTemplateTitle": "Row Content Template",
5532+
"RowContentTemplateIntro": "By setting the <code>RowContentTemplate</code> template, you can implement custom row cell linkage logic by sub-packaging components to achieve performance optimization and avoid the problem of refreshing the entire table component after linkage due to cell data refresh.",
5533+
"RowContentTemplateDesc": "In this example, a custom component is used to select a date, link the quantity column, randomly generate a random number, and save it to the original data, so there is no need to refresh the entire <code>Table</code> component.",
55315534
"RowTemplateTitle": "Row Template",
5532-
"RowTemplateIntro": "By setting the <code>RowTemplate</code> template, you can implement custom row cell linkage logic by sub-packaging components to achieve performance optimization and avoid the problem of refreshing the entire table component after linkage due to cell data refresh.",
5533-
"RowTemplateDesc": "In this example, a custom component is used to select a date, link the quantity column, randomly generate a random number, and save it to the original data, so there is no need to refresh the entire <code>Table</code> component."
5535+
"RowTemplateIntro": "By setting the <code>RowTemplate</code> template, you can implement the row merging function according to your own business logic"
55345536
},
55355537
"BootstrapBlazor.Server.Components.Samples.Table.TablesDynamic": {
55365538
"TablesDynamicTitle": "Table Dynamic",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5528,9 +5528,11 @@
55285528
"ClickToSelectP3": "当前选中行:",
55295529
"ClickToSelectNoneText": "",
55305530
"PlaceHolder": "不可为空,50字以内",
5531+
"RowContentTemplateTitle": "行内容模板",
5532+
"RowContentTemplateIntro": "通过设置 <code>RowContentTemplate</code> 模板,可通过分装组件的方式实现自定义行内单元格联动逻辑,达到性能最优化,避免单元格数据刷新导致联动后需要刷新整个表格组件的问题,可用于销售类软件,调整单价时总价列变化需求",
5533+
"RowContentTemplateDesc": "本例中通过自定义组件,实现选择日期后,联动数量列,随机生成一个随机数字,并且保存到原始数据中,从而不需要刷新整个 <code>Table</code> 组件",
55315534
"RowTemplateTitle": "行模板",
5532-
"RowTemplateIntro": "通过设置 <code>RowTemplate</code> 模板,可通过分装组件的方式实现自定义行内单元格联动逻辑,达到性能最优化,避免单元格数据刷新导致联动后需要刷新整个表格组件的问题,可用于销售类软件,调整单价时总价列变化需求",
5533-
"RowTemplateDesc": "本例中通过自定义组件,实现选择日期后,联动数量列,随机生成一个随机数字,并且保存到原始数据中,从而不需要刷新整个 <code>Table</code> 组件"
5535+
"RowTemplateIntro": "通过设置 <code>RowTemplate</code> 模板,可以根据自己的业务逻辑实现行合并功能"
55345536
},
55355537
"BootstrapBlazor.Server.Components.Samples.Table.TablesDynamic": {
55365538
"TablesDynamicTitle": "Table 表格",

0 commit comments

Comments
 (0)