Skip to content

Commit c36fb39

Browse files
committed
feat: 虚拟滚动模式下禁止编辑
1 parent a45ab12 commit c36fb39

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/BootstrapBlazor/Components/Table/Table.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
}
4848
@if (ShowDefaultButtons)
4949
{
50-
@if (ShowAddButton)
50+
@if (ShowAddButton && ScrollMode == ScrollMode.None)
5151
{
5252
<TableToolbarButton TItem="TItem" Color="Color.Success" OnClick="AddAsync" Icon="@AddButtonIcon" Text="@AddButtonText" IsDisabled="GetAddButtonStatus()" />
5353
}
54-
@if (!IsExcel && ShowEditButton)
54+
@if (!IsExcel && ShowEditButton && ScrollMode == ScrollMode.None)
5555
{
5656
<TableToolbarButton TItem="TItem" IsDisabled="GetEditButtonStatus()" Color="Color.Primary" OnClick="EditAsync" Icon="@EditButtonIcon" Text="@EditButtonText" IsEnableWhenSelectedOneRow="true" />
5757
}

src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ private Task ExportExcelAsync() => ExecuteExportAsync(() => OnExportAsync != nul
12191219
/// 是否显示行内编辑按钮
12201220
/// </summary>
12211221
/// <returns></returns>
1222-
protected bool GetShowExtendEditButton(TItem item) => ShowExtendEditButtonCallback?.Invoke(item) ?? ShowExtendEditButton;
1222+
protected bool GetShowExtendEditButton(TItem item) => ScrollMode != ScrollMode.Virtual && (ShowExtendEditButtonCallback?.Invoke(item) ?? ShowExtendEditButton);
12231223

12241224
/// <summary>
12251225
/// 是否显示行内删除按钮

0 commit comments

Comments
 (0)