Skip to content

MudDataGrid: Fixed serverData + virtualization bug (#5664)#9086

Merged
henon merged 11 commits intoMudBlazor:devfrom
KapustinVadim1991:feature/fix-server-data-virtualization
Jun 3, 2024
Merged

MudDataGrid: Fixed serverData + virtualization bug (#5664)#9086
henon merged 11 commits intoMudBlazor:devfrom
KapustinVadim1991:feature/fix-server-data-virtualization

Conversation

@KapustinVadim1991
Copy link
Contributor

Adding virtualization support to the DataGrid when fetching data from the server via ServerData.

Description

In my previous PR (#9019), I made a significant mistake.

Using GridState with Page and PageSize properties is incorrect. The Virtualize component passes the StartIndex property through ItemsProvider, from which PageNumber cannot be calculated.

In the new version, I added VirtualizeServerData since it is necessary to return a new model with correct StartIndex and Count properties. Additionally, it was an oversight not to include the Placeholder property in mudVirtualize, as without placeholder rows of the same height as other rows, virtualization does not work correctly. This has been fixed.

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended docs Updates/improvements to project documentation that do not affect core library logic PR: needs review labels May 30, 2024
@ScarletKuro ScarletKuro requested a review from tjscience May 30, 2024 11:07
@codecov
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 90.66%. Comparing base (28bc599) to head (b55d89b).
Report is 245 commits behind head on dev.

Files Patch % Lines
...MudBlazor/Components/DataGrid/MudDataGrid.razor.cs 95.45% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9086      +/-   ##
==========================================
+ Coverage   89.82%   90.66%   +0.83%     
==========================================
  Files         412      398      -14     
  Lines       11878    12410     +532     
  Branches     2364     2412      +48     
==========================================
+ Hits        10670    11251     +581     
+ Misses        681      621      -60     
- Partials      527      538      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro
Copy link
Member

Is this related #9084?

@ScarletKuro ScarletKuro requested a review from henon May 30, 2024 22:42
@Duckislate97
Copy link

Is this related #9084?

This certainly seems like a solution fit for my use case.

@henon henon removed docs Updates/improvements to project documentation that do not affect core library logic PR: needs review labels Jun 3, 2024
@henon henon merged commit 0835b39 into MudBlazor:dev Jun 3, 2024
@henon
Copy link
Contributor

henon commented Jun 3, 2024

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants