Skip to content
Merged
Changes from 3 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
14 changes: 13 additions & 1 deletion src/BootstrapBlazor/Dynamic/DataTableDynamicContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

private Action<DataTableDynamicContext, ITableColumn>? AddAttributesCallback { get; set; }

/// <summary>
/// 获得/设置 是否启用内部缓存 默认 true 启用
/// </summary>
public bool UseCache { get; set; } = true;

/// <summary>
/// 负责将 DataRow 与 Items 关联起来方便查找提高效率
/// </summary>
Expand Down Expand Up @@ -104,7 +109,14 @@
/// <returns></returns>
public override IEnumerable<IDynamicObject> GetItems()
{
Items ??= BuildItems();
if (UseCache)
{
Items ??= BuildItems();
}
else
{
Items = BuildItems();
}

Check warning on line 119 in src/BootstrapBlazor/Dynamic/DataTableDynamicContext.cs

View check run for this annotation

Codecov / codecov/patch

src/BootstrapBlazor/Dynamic/DataTableDynamicContext.cs#L117-L119

Added lines #L117 - L119 were not covered by tests
return Items;
}

Expand Down