!2836 fix(#I59SLY): add column list null check

* chore: bump version 6.6.19
* fix: 增加列设置保护
* revert: 撤销对子类可见
This commit is contained in:
Argo 2022-05-29 12:02:43 +00:00
parent 4e776fedfe
commit f41e44783f
3 changed files with 10 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<Version>6.6.18</Version>
<Version>6.6.19</Version>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

View File

@ -72,12 +72,15 @@
<div class="dropdown-menu dropdown-menu-right shadow">
@foreach (var item in Columns)
{
var poco = ColumnVisibles.First(i => i.FieldName == item.GetFieldName());
<div class="dropdown-item">
<Checkbox ShowAfterLabel="true" IsDisabled="@GetColumnsListState(item)"
var poco = ColumnVisibles.FirstOrDefault(i => i.FieldName == item.GetFieldName());
if (poco != null)
{
<div class="dropdown-item">
<Checkbox ShowAfterLabel="true" IsDisabled="@GetColumnsListState(item)"
DisplayText="@item.GetDisplayName()" @bind-Value="@poco.Visible">
</Checkbox>
</div>
</Checkbox>
</div>
}
}
</div>
</div>

View File

@ -216,7 +216,7 @@ public partial class Table<TItem>
/// <summary>
/// 获得/设置 各列是否显示状态集合
/// </summary>
protected List<ColumnVisibleItem> ColumnVisibles { get; } = new();
private List<ColumnVisibleItem> ColumnVisibles { get; } = new();
private class ColumnVisibleItem
{