Skip to content

Commit 269580f

Browse files
Lambert LeeArgoZhang
authored andcommitted
!3776 doc(#I6B4RV): update TablesTracking demo
* update TablesTracking demo
1 parent 790d9ef commit 269580f

5 files changed

Lines changed: 55 additions & 57 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<div>
2+
<Table TItem="Foo" IsTracking="true" @bind-Items="Items" ShowToastAfterSaveOrDeleteModel="false"
3+
IsBordered="true" IsMultipleSelect="true" ShowToolbar="true" ShowExtendButtons="true">
4+
<TableColumns>
5+
<TableColumn @bind-Field="@context.DateTime" Width="180" />
6+
<TableColumn @bind-Field="@context.Name" />
7+
<TableColumn @bind-Field="@context.Address" />
8+
</TableColumns>
9+
</Table>
10+
</div>
11+
12+
@code {
13+
/// <summary>
14+
/// Foo 类为Demo测试用,如有需要请自行下载源码查阅
15+
/// Foo class is used for Demo test, please download the source code if necessary
16+
/// https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/main/src/BootstrapBlazor.Shared/Data/Foo.cs
17+
/// </summary>
18+
[NotNull]
19+
private IEnumerable<Foo>? Items { get; set; }
20+
21+
[Inject]
22+
[NotNull]
23+
private IStringLocalizer<Foo>? LocalizerFoo { get; set; }
24+
25+
/// <summary>
26+
/// OnInitialized 方法
27+
/// </summary>
28+
protected override void OnInitialized()
29+
{
30+
base.OnInitialized();
31+
32+
Items = Foo.GenerateFoo(LocalizerFoo, 4);
33+
}
34+
}

src/BootstrapBlazor.Shared/Locales/en.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5396,12 +5396,12 @@
53965396
"TablesWrapCustomCellTemplate_Time": "time"
53975397
},
53985398
"BootstrapBlazor.Shared.Samples.Table.TablesTracking": {
5399-
"H1": "Table table",
5400-
"H2": "Applicable to application scenarios where parent and child tables are submitted together",
5401-
"P1": "tracking mode",
5402-
"P2": "Set <code>IsTracking</code> with <code>Items</code> without setting <code>OnSaveAsync</code> and other callback methods",
5403-
"P3": "The prompt information of the <b>Save</b> <b>Delete</b> button can be turned off by setting <code>ShowToastAfterSaveOrDeleteModel='false'</code>",
5404-
"P4": "All data editing in this mode edits the original data and updates the data source through <code>bind-Items</code>, so no <b>Cancel</b> button is provided"
5399+
"TablesTrackingTitle": "Table table",
5400+
"TablesTrackingDescription": "Applicable to application scenarios where parent and child tables are submitted together",
5401+
"TablesTrackingNormalTitle": "tracking mode",
5402+
"TablesTrackingNormalIntro": "Set <code>IsTracking</code> with <code>Items</code> without setting <code>OnSaveAsync</code> and other callback methods",
5403+
"TablesTrackingNormaltips1": "The prompt information of the <b>Save</b> <b>Delete</b> button can be turned off by setting <code>ShowToastAfterSaveOrDeleteModel='false'</code>",
5404+
"TablesTrackingNormaltips2": "All data editing in this mode edits the original data and updates the data source through <code>bind-Items</code>, so no <b>Cancel</b> button is provided"
54055405
},
54065406
"BootstrapBlazor.Shared.Samples.Table.TablesFooter": {
54075407
"H1": "Table Footer",

src/BootstrapBlazor.Shared/Locales/zh.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5426,12 +5426,12 @@
54265426
"TablesWrapCustomCellTemplate_Time": "时间"
54275427
},
54285428
"BootstrapBlazor.Shared.Samples.Table.TablesTracking": {
5429-
"H1": "Table 表格",
5430-
"H2": "适用于父子表一起提交的应用场景",
5431-
"P1": "跟踪模式",
5432-
"P2": "设置 <code>IsTracking</code> 配合 <code>Items</code> 可以不需要设置 <code>OnSaveAsync</code> 等回调方法",
5433-
"P3": "可通过设置 <code>ShowToastAfterSaveOrDeleteModel='false'</code> 关闭 <b>保存</b> <b>删除</b> 按钮的提示信息",
5434-
"P4": "此模式下所有数据编辑均编辑原始数据,通过 <code>bind-Items</code> 更新数据源,所以不提供 <b>取消</b> 按钮"
5429+
"TablesTrackingTitle": "Table 表格",
5430+
"TablesTrackingDescription": "适用于父子表一起提交的应用场景",
5431+
"TablesTrackingNormalTitle": "跟踪模式",
5432+
"TablesTrackingNormalIntro": "设置 <code>IsTracking</code> 配合 <code>Items</code> 可以不需要设置 <code>OnSaveAsync</code> 等回调方法",
5433+
"TablesTrackingNormaltips1": "可通过设置 <code>ShowToastAfterSaveOrDeleteModel='false'</code> 关闭 <b>保存</b> <b>删除</b> 按钮的提示信息",
5434+
"TablesTrackingNormaltips2": "此模式下所有数据编辑均编辑原始数据,通过 <code>bind-Items</code> 更新数据源,所以不提供 <b>取消</b> 按钮"
54355435
},
54365436
"BootstrapBlazor.Shared.Samples.Table.TablesAutoRefresh": {
54375437
"TablesAutoRefreshTitle": "自动刷新表格功能",
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
@page "/tables/tracking"
2+
@inject IStringLocalizer<TablesTracking> Localizer
23

3-
<h3>@Localizer["H1"]</h3>
4-
<h4>@Localizer["H2"]</h4>
4+
<h3>@Localizer["TablesTrackingTitle"]</h3>
5+
<h4>@Localizer["TablesTrackingDescription"]</h4>
56

6-
<DemoBlock Title="@Localizer["P1"]" Introduction="@Localizer["P2"]" Name="IsTracking">
7-
<p>@((MarkupString)Localizer["P3"].Value)</p>
8-
<p>@((MarkupString)Localizer["P4"].Value)</p>
9-
<Table TItem="Foo" IsTracking="true" @bind-Items="Items" ShowToastAfterSaveOrDeleteModel="false"
10-
IsBordered="true" IsMultipleSelect="true" ShowToolbar="true" ShowExtendButtons="true">
11-
<TableColumns>
12-
<TableColumn @bind-Field="@context.DateTime" Width="180" />
13-
<TableColumn @bind-Field="@context.Name" />
14-
<TableColumn @bind-Field="@context.Address" />
15-
</TableColumns>
16-
</Table>
7+
<DemoBlock Title="@Localizer["TablesTrackingNormalTitle"]"
8+
Introduction="@Localizer["TablesTrackingNormalIntro"]"
9+
Name="Normal"
10+
Demo="typeof(Demos.Table.TablesTracking.TablesTrackingNormal)">
11+
<p>@((MarkupString)Localizer["TablesTrackingNormaltips1"].Value)</p>
12+
<p>@((MarkupString)Localizer["TablesTrackingNormaltips2"].Value)</p>
1713
</DemoBlock>

src/BootstrapBlazor.Shared/Samples/Table/TablesTracking.razor.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)