Skip to content

Commit

Permalink
doc(Table): update sample code of EditTemplate (#2632)
Browse files Browse the repository at this point in the history
* doc: 更新示例链接

* doc: 更新示例按钮

* doc: 更新编辑示例

* doc: 更新文档

* doc: 增加忽略项
  • Loading branch information
ArgoZhang authored Dec 21, 2023
1 parent a39ac00 commit 98e85d8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<DemoBlock Title="@Localizer["TableColumnTitle"]"
Introduction="@Localizer["TableColumnIntro"]"
Name="TableColumnNormal">
<p>@((MarkupString)Localizer["TableColumnP1"].Value)</p>
<p>@((MarkupString)Localizer["TableColumnP2"].Value)</p>
<p>@((MarkupString)Localizer["TableColumnP3"].Value)</p>
<p>@((MarkupString)Localizer["TableColumnP3"].Value)</p>
<ul class="mb-3">
<li>@((MarkupString)Localizer["TableColumnLi1"].Value)</li>
<li>@((MarkupString)Localizer["TableColumnLi2"].Value)</li>
</ul>

<section ignore>
<p>@((MarkupString)Localizer["TableColumnP1"].Value)</p>
<p>@((MarkupString)Localizer["TableColumnP2"].Value)</p>
<p>@((MarkupString)Localizer["TableColumnP3"].Value)</p>
<ul class="mb-3">
<li>@((MarkupString)Localizer["TableColumnLi1"].Value)</li>
<li>@((MarkupString)Localizer["TableColumnLi2"].Value)</li>
</ul>
</section>
<Table TItem="Foo"
IsPagination="true" PageItemsSource="@PageItemsSource"
IsStriped="true" IsBordered="true"
Expand Down Expand Up @@ -63,7 +63,7 @@
<TableColumn @bind-Field="@context.Count" />
<TableColumn @bind-Field="@context.Id" Text="">
<Template Context="v">
<PopConfirmButton Text="Test" Size="Size.ExtraSmall" />
<PopConfirmButton Color="Color.Primary" Text="Test" Size="Size.ExtraSmall" />
</Template>
</TableColumn>
</TableColumns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

<DemoBlock Title="@Localizer["TablesColumnEditTemplateTitle"]"
Introduction="@Localizer["TablesColumnEditTemplateIntro"]"
Name="EditTemplate">
Name="ColumnEditTemplate">
<section ignore class="mb-3">
<div>@((MarkupString)Localizer["TablesColumnEditTemplateDescription1"].Value)</div>
<div>@((MarkupString)Localizer["TablesColumnEditTemplateTips"].Value)</div>
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4881,7 +4881,7 @@
"AutoGenerateColumnsP1": "In this example, by setting the value of <code>AutoGenerateColumns</code> to <code>true</code>, the automatic column generation function is enabled. All attributes of the bound model entity class are all generated by default. code>AutoGenerateColumnAttribute</code> tag class for function settings, such as: ",
"AutoGenerateColumnsLi1": "<code>Ignore</code> means ignore this property, i.e. not generate",
"AutoGenerateColumnsLi2": "<code>Readonly</code> means read only",
"AutoGenerateColumnsLi3": "For more attributes, see <a href=\"{0}/blob/master/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs\" target=\"_blank\" >Source code</a>",
"AutoGenerateColumnsLi3": "For more attributes, see <a href=\"{0}/blob/main/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs\" target=\"_blank\" >Source code</a>",
"AutoGenerateColumnsP2": " In this example the <code>date</code> column is formatted through the <code>[AutoGenerateColumn(Order = 1, FormatString = \"yyyy-MM-dd\")]</code> tag; Set the template column in the code to customize the <code>Complete</code> column and use the <code>Switch</code> component to render; through the <code>[AutoGenerateColumn(Order = 10)]</code> tag in the <code>Order</code> set the display order"
},
"BootstrapBlazor.Server.Components.Samples.Table.TablesEdit": {
Expand Down
6 changes: 3 additions & 3 deletions src/BootstrapBlazor.Server/Locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -4868,7 +4868,7 @@
"TablesColumnTitle": "Table 表格",
"TablesColumnDescription": "用于展示多条结构类似的数据,可对数据进行排序、筛选、对比或其他自定义操作。",
"TableColumnTitle": "自定义列数据模板",
"TableColumnIntro": "自定义 <code>TableColumn</code> 列的 <code>Template</code> 模板来实现任意 UI",
"TableColumnIntro": "自定义 <code>TableColumn</code> 列的 <code>Template</code> 模板来实现任意显示 UI,<code>EditTemplate</code> 可实现编辑模式下 UI",
"TableColumnP1": " 本例中列 <code>DateTime</code> 值根据 <code>Complete</code> 值是否为 <code>true</code> 显示不同颜色",
"TableColumnP2": "本例中列 <code>Complete</code> 根据 <code>Complete</code> 值自定义显示为 <code>Checkbox</code> 组件",
"TableColumnP3": "<code>Template</code> 模板自带 <code>Context</code> 相关联上下文,其值为 <code>TableColumnContext</code> 类型",
Expand All @@ -4881,7 +4881,7 @@
"AutoGenerateColumnsP1": "本例中通过设置 <code>AutoGenerateColumns</code> 值为 <code>true</code> 开启自动生成列功能,默认绑定模型实体类所有属性全部生成,实体类可以通过 <code>AutoGenerateColumnAttribute</code> 标签类进行功能设置,如:",
"AutoGenerateColumnsLi1": "<code>Ignore</code> 表示忽略此属性,即不生成",
"AutoGenerateColumnsLi2": "<code>Readonly</code> 表示只读",
"AutoGenerateColumnsLi3": "更多属性详见 <a href=\"{0}/blob/master/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs\" target=\"_blank\">源码</a>",
"AutoGenerateColumnsLi3": "更多属性详见 <a href=\"{0}/blob/main/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs\" target=\"_blank\">源码</a>",
"AutoGenerateColumnsP2": " 本例中通过 <code>[AutoGenerateColumn(Order = 1, FormatString = \"yyyy-MM-dd\")]</code> 标签格式化 <code>日期</code> 列;通过代码中设置模板列对 <code>Complete</code> 列进行自定义使用 <code>Switch</code> 组件进行渲染;通过 <code>[AutoGenerateColumn(Order = 10)]</code> 标签中的 <code>Order</code> 对显示顺序进行设定"
},
"BootstrapBlazor.Server.Components.Samples.Table.TablesEdit": {
Expand All @@ -4892,7 +4892,7 @@
"TablesEditItemsDescription": "设置 <code>Items</code> 作为数据源,必须使用双向绑定 <code>@bind-Items</code> 否则内置编辑功能无法正常工作",
"TablesEditTemplateTitle": "具有单表维护功能的表格",
"TablesEditTemplateIntro": "通过设置 <code>EditTemplate</code> 自定义编辑弹窗,如果属性需要联动时必须像本例这样封装成一个独立的组件再放置到模板中",
"TablesEditTemplateDescription": "本例中设置 <code>Count</code> 右侧对齐,<code>Complete</code> 列设置为居中对齐,布尔类型列自动渲染成 <code>Switch</code> 组件,点击 <code>学历</code> 下拉框时右侧只读组件描述信息联动更新,此功能必须封装成独立组件",
"TablesEditTemplateDescription": "本例中设置 <code>Count</code> 右侧对齐,<code>Complete</code> 列设置为居中对齐,布尔类型列自动渲染成 <code>Switch</code> 组件,点击 <code>学历</code> 下拉框时右侧只读组件描述信息联动更新,<b>此功能必须封装成独立组件</b>",
"TablesEditTemplateDisplayLabel": "详细信息",
"TablesEditTemplateDisplayDetail1": "小学六年",
"TablesEditTemplateDisplayDetail2": "初中三年",
Expand Down

0 comments on commit 98e85d8

Please sign in to comment.