-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataGrid: ServerData with Virtualization #9019
DataGrid: ServerData with Virtualization #9019
Conversation
…tualization' into feature/datagrid-server-data-virtualization
…tualization' into feature/datagrid-server-data-virtualization
…tualization' into feature/datagrid-server-data-virtualization
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #9019 +/- ##
==========================================
+ Coverage 89.82% 90.49% +0.66%
==========================================
Files 412 394 -18
Lines 11878 12157 +279
Branches 2364 2368 +4
==========================================
+ Hits 10670 11002 +332
+ Misses 681 620 -61
- Partials 527 535 +8 ☔ View full report in Codecov by Sentry. |
Thanks, this looks much simpler than the #7258 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good aside from the call in SetParametersAsync of the MudDataGrid.
@@ -890,6 +898,7 @@ public override async Task SetParametersAsync(ParameterView parameters) | |||
var sortModeBefore = SortMode; | |||
await base.SetParametersAsync(parameters); | |||
|
|||
VirtualItemsProviderInitialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we limit calling this only when Parameters change that this feature relies on, for example, SortDefinitions and FilterDefinitions? I worry that this will be called too many times since it is in SetParametersAsync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tjscience Good evening, you are right, I needed to add a check to avoid reinitializing the delegate, which I have now added. I didn't quite understand why we need to update the delegate when SortDefinitions/FilterDefinitions change; there might have been a misunderstanding. But if it's necessary, please let me know 😊
…rovider delegate.
@tjscience is it good to go now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, thanks!
Thanks |
@ScarletKuro Could you please let me know if there is anything I need to do to ensure that this improvement is included in the next preview of MudBlazor v7?Or is this process documented somewhere? |
It will be automatically included in the next v7 preview, which might happen soon. Stay tuned. |
Adding virtualization support to the DataGrid when fetching data from the server via ServerData.
Description
Adding an ItemsProvider delegate to the DataGrid and passing it to the virtualization component for asynchronous fetching of list items during scrolling without a paginator.
This PR is a modification and, in my opinion, an improvement/simplification of the code from PR #7258 . In my approach, to implement virtualization combined with loading items from the server, it is sufficient to specify the ServerData and Virtualization parameters.
Type of Changes
Checklist
dev
).