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/Core.Assets/esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as esbuild from 'esbuild'
import pkg from './package.json' assert { type: 'json' }
import pkg from './package.json' with { type: 'json' }

await esbuild.build({
entryPoints: [ pkg.source ],
Expand Down
5 changes: 3 additions & 2 deletions src/Core/Components/DataGrid/FluentDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ private async Task RefreshDataCoreAsync()
// the current viewport. In the case where you're also paginating then it means what's conceptually on the current page.
// TODO: This currently assumes we always want to expand the last page to have ItemsPerPage rows, but the experience might
// be better if we let the last page only be as big as its number of actual rows.
_internalGridContext.TotalItemCount = Pagination is null ? providerResult.TotalItemCount : Pagination.ItemsPerPage;
_internalGridContext.TotalItemCount = providerResult.TotalItemCount;
_internalGridContext.TotalViewItemCount = Pagination?.ItemsPerPage ?? providerResult.TotalItemCount;

Pagination?.SetTotalItemCountAsync(_internalGridContext.TotalItemCount);
if (_internalGridContext.TotalItemCount > 0)
Expand All @@ -572,7 +573,7 @@ private async Task RefreshDataCoreAsync()
// to make sure it doesn't get out of sync with the rows being rendered.
return new ItemsProviderResult<(int, TGridItem)>(
items: providerResult.Items.Select((x, i) => ValueTuple.Create(i + request.StartIndex + 2, x)),
totalItemCount: _internalGridContext.TotalItemCount);
totalItemCount: _internalGridContext.TotalViewItemCount);
}

return default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ internal sealed class InternalGridContext<TGridItem>

public ICollection<TGridItem> Items { get; set; } = [];
public int TotalItemCount { get; set; }
public int TotalViewItemCount { get; set; }

public FluentDataGrid<TGridItem> Grid { get; }
public EventCallbackSubscribable<object?> ColumnsFirstCollected { get; } = new();
Expand Down