Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -5584,7 +5584,7 @@
"TablesExportShowExportCsvButtonTitle": "Export Csv/Pdf Button",
"TablesExportShowExportCsvButtonIntro": "Show/hide <code>Csv/Pdf</code> button by set <code>ShowExportCsvButton=\"true\"</code> <code>ShowExportPdfButton=\"true\"</code>",
"TablesExportOnExportAsyncTitle": "Custom export method",
"TablesExportOnExportAsyncIntro": "You can customize the export method by setting the <code>OnExportAsync</code> callback delegate method. If you don't set it, the built-in export function of the component will be used.",
"TablesExportOnExportAsyncIntro": "You can customize the export method by setting the <code>OnExportAsync</code> callback delegate method. If you don't set it, the built-in export function of the component will be used. You can set the column property <code>IgnoreWhenExport=\"true\"</code> to ignore this column when exporting",
"TablesExportButtonDropdownTemplateTitle": "Custom export dropdown button",
"TablesExportButtonDropdownTemplateIntro": "Customize the content of the export button dropdown box by setting the <code>ExportButtonDropdownTemplate</code> template",
"TablesExportButtonExcelText": "Export Page data - Excel",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5584,7 +5584,7 @@
"TablesExportShowExportCsvButtonTitle": "导出 Csv/Pdf",
"TablesExportShowExportCsvButtonIntro": "通过设置 <code>ShowExportCsvButton=\"true\"</code> <code>ShowExportPdfButton=\"true\"</code> 控制 <code>Csv/Pdf</code> 导出按钮",
"TablesExportOnExportAsyncTitle": "自定义导出方法",
"TablesExportOnExportAsyncIntro": "通过设置 <code>OnExportAsync</code> 回调委托方法可自定义导出方法,不设置将使用组件内置导出函数",
"TablesExportOnExportAsyncIntro": "通过设置 <code>OnExportAsync</code> 回调委托方法可自定义导出方法,不设置将使用组件内置导出函数,可通过设置列属性 <code>IgnoreWhenExport=\"true\"</code> 导出时忽略此列",
"TablesExportButtonDropdownTemplateTitle": "自定义导出下拉框按钮",
"TablesExportButtonDropdownTemplateIntro": "通过设置 <code>ExportButtonDropdownTemplate</code> 模板自定义导出按钮下拉框内容",
"TablesExportButtonExcelText": "导出当前页数据 Excel",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.6.2-beta02</Version>
<Version>9.6.2-beta03</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion src/BootstrapBlazor/Components/Table/Table.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ private string GetSortTooltip(ITableColumn col) => SortName != col.GetFieldName(
[Parameter]
public bool IsExcel { get; set; }

/// <summary>
/// 获得/设置 是否启用 Excel 模式下的键盘导航功能 默认 true
/// </summary>
[Parameter]
public bool EnableKeyboardNavigationCell { get; set; } = true;

/// <summary>
/// 获得/设置 是否显示明细行 默认为 null 为空时使用 <see cref="DetailRowTemplate" /> 进行逻辑判断
/// </summary>
Expand Down Expand Up @@ -1054,7 +1060,8 @@ private async Task OnTableRenderAsync(bool firstRender)
Text = Localizer["AlignRightText"].Value,
Tooltip = Localizer["AlignRightTooltipText"].Value
}
}
},
EnableKeyboardNavigationCell
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Components/Table/Table.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function reset(id) {
table.tables.push(shim.firstChild)
}

if (table.isExcel) {
if (table.options.enableKeyboardNavigationCell === true && table.isExcel) {
setExcelKeyboardListener(table)
}

Expand Down Expand Up @@ -232,7 +232,7 @@ const destroyTable = table => {
EventHandler.off(table.body, 'scroll')
}

if (table.isExcel) {
if (table.options.enableKeyboardNavigationCell === true && table.isExcel) {
EventHandler.off(table.element, 'keydown')
}

Expand Down
2 changes: 1 addition & 1 deletion test/UnitTest/Components/TableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Reflection;
using System.Runtime.CompilerServices;

namespace UnitTest.Components;

Expand Down Expand Up @@ -581,6 +580,7 @@ public async Task ShowToolbar_IsExcel_Ok()
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.IsExcel, true);
pb.Add(a => a.EnableKeyboardNavigationCell, true);
pb.Add(a => a.Items, items);
pb.Add(a => a.OnSaveAsync, (foo, changedItem) =>
{
Expand Down