mirror of
https://github.com/dotnetcore/BootstrapBlazor.git
synced 2025-12-20 10:26:41 +08:00
!3183 feat(#I5PAVH): add ClrearCheckedItems method on TreeView
* feat: 提供清除选出项方法
This commit is contained in:
@@ -396,6 +396,24 @@ public partial class TreeView<TItem>
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除 所有选中节点
|
||||
/// </summary>
|
||||
public void ClrearCheckedItems()
|
||||
{
|
||||
Items.ForEach(item =>
|
||||
{
|
||||
item.CheckedState = CheckboxState.UnChecked;
|
||||
treeNodeCache.ToggleCheck(item);
|
||||
item.GetAllTreeSubItems().ToList().ForEach(s =>
|
||||
{
|
||||
s.CheckedState = CheckboxState.UnChecked;
|
||||
treeNodeCache.ToggleCheck(s);
|
||||
});
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得 所有选中节点集合
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user