From 086e27549a68bc36561f51d9bbf938a566c0108f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 26 Dec 2025 10:58:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?doc:=20=E7=A7=BB=E5=8A=A8=20ShowMoreButton?= =?UTF-8?q?=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/Table/TablesSearch.razor | 7 +------ .../Components/Samples/Table/TablesSearch.razor.cs | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor index 1d02a5b1606..76a3d9c2fff 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor @@ -1,4 +1,4 @@ -@page "/table/search" +@page "/table/search" @inject IStringLocalizer NavMenuLocalizer @inject IStringLocalizer Localizer @inject IStringLocalizer FooLocalizer @@ -49,11 +49,6 @@ - - - - - diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor.cs index 37cbe7464e0..f00eaf5249c 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesSearch.razor.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License // See the LICENSE file in the project root for more information. // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone @@ -183,9 +183,4 @@ private Task> OnQueryAsync(QueryPageOptions options) IsAdvanceSearch = options.CustomerSearches.Count > 0 && string.IsNullOrEmpty(options.SearchText), }); } - - [Inject, NotNull] - private ToastService? ToastService { get; set; } - - private Task OnAction(Foo foo, string actionName) => ToastService.Information(foo.Name, $"Trigger {actionName}"); } From 8690164074361265dc8f8f584e7d5924d4d3e0d6 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 26 Dec 2025 10:59:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20ShowMoreButton?= =?UTF-8?q?=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Samples/Table/TablesColumn.razor | 22 ++++++++++++++++++- .../Samples/Table/TablesColumn.razor.cs | 10 ++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor index 85fc233029b..3997e2d80ed 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor @@ -1,4 +1,4 @@ -@page "/table/column" +@page "/table/column" @inject IStringLocalizer NavMenuLocalizer @inject IStringLocalizer Localizer @inject IStringLocalizer FooLocalizer @@ -218,6 +218,26 @@ + + + + + + + + + + + + + +
+
+ diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor.cs index 8eb947bb216..fb89cd15419 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License // See the LICENSE file in the project root for more information. // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone @@ -192,6 +192,11 @@ private class Company(string name) public string Name { get; set; } = name; } + [Inject, NotNull] + private ToastService? ToastService { get; set; } + + private Task OnAction(Foo foo, string actionName) => ToastService.Information(foo.Name, $"Trigger {actionName}"); + /// /// 示例复杂类型 ComplexFoo /// Complex class sample ComplexFoo @@ -239,8 +244,7 @@ public ComplexFoo(int age) /// 返回一个含有随机数据的 ComplexFoo 实例集合 /// Return a List of ComplexFoo instances with random data /// - public static List GenerateComplexFoo(IStringLocalizer localizer, int count = 80) - => Enumerable.Range(1, count).Select(i => new ComplexFoo(Random.Shared.Next(20, 65)) + public static List GenerateComplexFoo(IStringLocalizer localizer, int count = 80) => Enumerable.Range(1, count).Select(i => new ComplexFoo(Random.Shared.Next(20, 65)) { Id = i, Name = localizer["Foo.Name", $"{i:d4}"], From bb7e0e1ba2b951417073e59dd65256f4022406c9 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 26 Dec 2025 11:16:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A8=A1=E6=9D=BF=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/Table/TablesColumn.razor | 8 ++++++++ src/BootstrapBlazor.Server/Locales/en-US.json | 5 ++++- src/BootstrapBlazor.Server/Locales/zh-CN.json | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor index 3997e2d80ed..2891cc20b6b 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumn.razor @@ -219,6 +219,14 @@ +
+

@((MarkupString)Localizer["ShowMoreButtonDesc"].Value)

+
<MoreButtonDropdownTemplate>
+    <DropdownItem Text="Action1" Icon="fa-solid fa-flag" OnClick="@@(() => OnAction(context, "Action1"))"></DropdownItem>
+    <Divider></Divider>
+    <DropdownItem Text="Action2" Icon="fa-solid fa-home" OnClick="@@(() => OnAction(context, "Action2"))"></DropdownItem>
+</MoreButtonDropdownTemplate>
+
Ignore parameter to control whether the column is rendered, this parameter is different from Visible. SettingVisible=\"false\" to not display the column can be checked and displayed in the list through ShowColumnList=\"true\"", "ColumnIgnoreButtonText": "Ignoring/Not Ignoring", "ColumnOrderTitle": "Column Order", - "ColumnOrderIntro": "Set the order by setting the Order parameter of TableColumn" + "ColumnOrderIntro": "Set the order by setting the Order parameter of TableColumn", + "ShowMoreButtonTitle": "ShowMoreButton", + "ShowMoreButtonIntro": "By setting the ShowMoreButton parameter, a More button appears when the row expands. Furthermore, by setting the MoreButtonDropdownTemplate template, the dropdown menu options are customized. This design significantly reduces the amount of row space occupied.", + "ShowMoreButtonDesc": "MoreButtonDropdownTemplate Context context is the instance of the current row." }, "BootstrapBlazor.Server.Components.Samples.Table.TablesColumnDrag": { "TablesColumnTitle": "Table Column", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 8701b02695a..6d57d6d12ef 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -5108,7 +5108,10 @@ "ColumnIgnoreIntro": "通过设置 Ignore 参数控制列是否渲染,此参数与 Visible 不同,设置 Visible=\"false\" 后不显示列可通过 ShowColumnList=\"true\" 在列表中勾选并显示", "ColumnIgnoreButtonText": "忽略/不忽略", "ColumnOrderTitle": "列顺序", - "ColumnOrderIntro": "通过设置 TableColumnOrder 参数进行设置顺序" + "ColumnOrderIntro": "通过设置 TableColumnOrder 参数进行设置顺序", + "ShowMoreButtonTitle": "更多按钮", + "ShowMoreButtonIntro": "通过设置 ShowMoreButton 参数使行扩展按钮出现 更多 按钮,通过设置 MoreButtonDropdownTemplate 模板自定义下拉菜单选项,通过这样的设计大大减少行空间占用", + "ShowMoreButtonDesc": "MoreButtonDropdownTemplate 上下文 context 为当前行实例" }, "BootstrapBlazor.Server.Components.Samples.Table.TablesColumnDrag": { "TablesColumnTitle": "Table 表格",