Skip to content

Commit 4dbf65c

Browse files
committed
fix(Table): 修复不显示列显示名称为空问题
1 parent 59f1995 commit 4dbf65c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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)