From 352385e3c5f02e1f5534381b2a9e219f21639b5d Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Thu, 6 Jan 2022 18:55:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=97=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=A7=BB=E5=8A=A8=E5=88=B0=20Body=20?= =?UTF-8?q?=E5=86=85=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Table/Table.razor | 28 +++++++------------ .../Components/Table/Table.razor.cs | 11 +++++++- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor b/src/BootstrapBlazor/Components/Table/Table.razor index 11a20f34a..e3b860195 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor +++ b/src/BootstrapBlazor/Components/Table/Table.razor @@ -162,10 +162,6 @@
@RenderTable.Invoke(false) - @if(IsShowEmpty) - { - @RenderEmpty() - }
} else if (FixedExtendButtonsColumn || Columns.Any(col => col.Fixed)) @@ -173,18 +169,10 @@
@RenderTable.Invoke(true)
- @if(IsShowEmpty) - { - @RenderEmpty() - } } else { @RenderTable.Invoke(true) - @if(IsShowEmpty) - { - @RenderEmpty() - } } } else @@ -329,14 +317,9 @@ @RenderRow(item) if (!IsExcel && ShowDetails()) { - var colspan = ColumnVisibles.Count(col => col.Visible); - if (IsMultipleSelect) colspan++; - if (ShowLineNo) colspan++; - if (ShowExtendButtons) colspan++; -   - +
@DetailRowTemplate?.Invoke(item)
@@ -348,6 +331,15 @@ @RenderEditForm((EditModel, ItemChangedType.Update)) } } + @if(IsShowEmpty) + { + + + + + + + } } @if (ShowFooter) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index 1b61f09f0..7d84f7fea 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -1099,13 +1099,22 @@ public partial class Table : BootstrapComponentBase, IDisposable, ITable builder.OpenComponent(index++); builder.AddAttribute(index++, nameof(Empty.Text), EmptyText); builder.AddAttribute(index++, nameof(Empty.Image), EmptyImage); - if(EmptyTemplate != null) + if (EmptyTemplate != null) { builder.AddAttribute(index++, nameof(Empty.Template), EmptyTemplate); } builder.CloseComponent(); }; + private int GetColumnCount() + { + var colspan = ColumnVisibles.Count(col => col.Visible); + if (IsMultipleSelect) colspan++; + if (ShowLineNo) colspan++; + if (ShowExtendButtons) colspan++; + return colspan; + } + #region Dispose /// /// Dispose 方法 -- Gitee From c46e6a57f90b16cb707944b497e4741f09c10c92 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Thu, 6 Jan 2022 18:59:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20IsHideFooterWh?= =?UTF-8?q?enNoData=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor | 6 +++--- src/BootstrapBlazor/Components/Table/Table.razor.cs | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor b/src/BootstrapBlazor/Components/Table/Table.razor index e3b860195..00194e9d7 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor +++ b/src/BootstrapBlazor/Components/Table/Table.razor @@ -234,7 +234,7 @@ } } - @if (ShowFooter) + @if (ShowFooter && !IsHideFooterWhenNoData) {