Skip to content

Commit 38985b7

Browse files
authored
refactor(Table): add DisplayName parameter event invisible (#8011)
* fix(Table): 修复不显示列显示名称为空问题 * chore: bump version 10.6.1-beta22
1 parent 59f1995 commit 38985b7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>10.6.1-beta21</Version>
4+
<Version>10.6.1-beta22</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,13 @@ private void ResetVisibleColumnsCache()
561561
for (var index = 0; index < _tableColumnStates.Count; index++)
562562
{
563563
var item = _tableColumnStates[index];
564-
if (item.Visible)
564+
var col = Columns.Find(c => c.GetFieldName() == item.Name);
565+
if (col != null)
565566
{
566-
var col = Columns.Find(c => c.GetFieldName() == item.Name);
567-
if (col != null)
568-
{
569-
item.DisplayName = col.GetDisplayName();
567+
item.DisplayName = col.GetDisplayName();
570568

569+
if (item.Visible)
570+
{
571571
// 增加到可见列缓存集合
572572
_visibleColumnsCache.Add(col);
573573
}

0 commit comments

Comments
 (0)