Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>10.6.5-beta01</Version>
<Version>10.7.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
15 changes: 12 additions & 3 deletions src/BootstrapBlazor/Components/Table/Table.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,15 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
SortOrder = col.DefaultSortOrder;
}

// 调用查询方法渲染 UI
await QueryAsync(true, 1, false, true, IsAutoQueryFirstRender);
if (ScrollMode == ScrollMode.None)
{
// 调用查询方法渲染 UI
await QueryAsync(true, 1, false, true, IsAutoQueryFirstRender);
}
else
{
StateHasChanged();
}
return;
}

Expand Down Expand Up @@ -1750,13 +1757,15 @@ void SetEditTemplate()
public Dictionary<string, IFilterAction> Filters { get; } = [];
#endregion

private bool isFirstQuery = true;
private async ValueTask<ItemsProviderResult<TItem>> LoadItems(ItemsProviderRequest request)
{
StartIndex = _shouldScrollTop ? 0 : request.StartIndex;
_pageItems = request.Count;

await ToggleLoading(true);
await QueryData();
await QueryData(triggerByPagination: false, firstQuery: isFirstQuery);
isFirstQuery = false;
await ToggleLoading(false);

return new ItemsProviderResult<TItem>(QueryItems, TotalCount);
Expand Down
Loading