fix(module: table): rows which have been remove from selectedRows would be selected again (#3762)

* fix(module: table): rows which have been remove from selectedRows would be selected again.

* fix expand

* fix group selection
This commit is contained in:
James Yeung 2024-03-30 16:20:27 +08:00 committed by GitHub
parent 1d946b030d
commit b3f070c429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 4 deletions

View File

@ -31,6 +31,8 @@ namespace AntDesign
public void ExpandAll()
{
_preventRender = true;
foreach (var item in _rootRowDataCache)
{
item.Value.SetExpanded(true);
@ -39,6 +41,8 @@ namespace AntDesign
public void CollapseAll()
{
_preventRender = true;
foreach (var item in _rootRowDataCache)
{
item.Value.SetExpanded(false);

View File

@ -446,8 +446,6 @@ namespace AntDesign
return;
}
FlushCache();
var queryModel = this.InternalReload();
StateHasChanged();
if (OnChange.HasDelegate)
@ -475,9 +473,10 @@ namespace AntDesign
var queryModel = BuildQueryModel();
_currentQueryModel = queryModel;
FlushCache();
if (ServerSide)
{
FlushCache();
_showItems = _dataSource ?? Enumerable.Empty<TItem>();
_total = Total;
}
@ -838,6 +837,9 @@ namespace AntDesign
if (RowKey == null)
RowKey = data => data;
if (x is null && y is null)
return true;
return RowKey(x).Equals(RowKey(y));
}

View File

@ -84,7 +84,11 @@ namespace AntDesign.TableModels
internal void SetExpanded(bool expanded)
{
_expanded = expanded;
if (_expanded != expanded)
{
_expanded = expanded;
ExpandedChanged?.Invoke(this, _expanded);
}
}
protected abstract void CheckedChildren(bool isSelected, bool checkStrictly);