Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
52 changes: 26 additions & 26 deletions src/BootstrapBlazor/Components/Table/Table.razor
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
}
@if (ShowDefaultButtons)
{
@if (ShowAddButton)
@if (ShowAddButton && ScrollMode == ScrollMode.None)
{
<TableToolbarButton TItem="TItem" Color="Color.Success" OnClick="AddAsync" Icon="@AddButtonIcon" Text="@AddButtonText" IsDisabled="GetAddButtonStatus()" />
}
@if (!IsExcel && ShowEditButton)
@if (!IsExcel && ShowEditButton && ScrollMode == ScrollMode.None)
{
<TableToolbarButton TItem="TItem" IsDisabled="GetEditButtonStatus()" Color="Color.Primary" OnClick="EditAsync" Icon="@EditButtonIcon" Text="@EditButtonText" IsEnableWhenSelectedOneRow="true" />
}
Expand Down Expand Up @@ -366,17 +366,6 @@
@RenderHeader(false)
}
<tbody>
@if (InsertRowMode == InsertRowMode.First)
{
if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm)
{
@RenderEditForm.Invoke((EditModel, ItemChangedType.Add))
}
if (AddInCell)
{
@RenderRow(EditModel)
}
}
@if (ScrollMode == ScrollMode.Virtual)
{
@if (Items != null)
Expand All @@ -394,7 +383,18 @@
}
else
{
@foreach (var item in Rows)
if (InsertRowMode == InsertRowMode.First)
{
if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm)
{
@RenderEditForm.Invoke((EditModel, ItemChangedType.Add))
}
if (AddInCell)
{
@RenderRow(EditModel)
}
}
foreach (var item in Rows)
{
OnBeforeRenderRow?.Invoke(item);
if (RowTemplate != null)
Expand Down Expand Up @@ -439,7 +439,18 @@
@RenderEditForm((EditModel, ItemChangedType.Update))
}
}
@if (IsShowEmpty)
if (InsertRowMode == InsertRowMode.Last)
{
if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm)
{
@RenderEditForm.Invoke((EditModel, ItemChangedType.Add))
}
if (AddInCell)
{
@RenderRow(EditModel)
}
}
if (IsShowEmpty)
{
<tr>
<td colspan="@GetEmptyColumnCount()">
Expand All @@ -449,17 +460,6 @@
</tr>
}
}
@if (InsertRowMode == InsertRowMode.Last)
{
if (!IsExcel && EditMode == EditMode.EditForm && ShowAddForm)
{
@RenderEditForm.Invoke((EditModel, ItemChangedType.Add))
}
if (AddInCell)
{
@RenderRow(EditModel)
}
}
</tbody>
@if (IsShowFooter)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ private Task ExportExcelAsync() => ExecuteExportAsync(() => OnExportAsync != nul
/// 是否显示行内编辑按钮
/// </summary>
/// <returns></returns>
protected bool GetShowExtendEditButton(TItem item) => ShowExtendEditButtonCallback?.Invoke(item) ?? ShowExtendEditButton;
protected bool GetShowExtendEditButton(TItem item) => ScrollMode != ScrollMode.Virtual && (ShowExtendEditButtonCallback?.Invoke(item) ?? ShowExtendEditButton);

/// <summary>
/// 是否显示行内删除按钮
Expand Down
Loading