Skip to content

MudDataGridPager: Add ShowNavigation and ShowPageNumber#8363

Merged
henon merged 6 commits intoMudBlazor:devfrom
mckaragoz:DataGridPagerHideNavigation
Apr 11, 2024
Merged

MudDataGridPager: Add ShowNavigation and ShowPageNumber#8363
henon merged 6 commits intoMudBlazor:devfrom
mckaragoz:DataGridPagerHideNavigation

Conversation

@mckaragoz
Copy link
Member

DataGridPager doesn't have HideNavigation and HidePageNumber parameters which TablePager has. This PR added these two parameters.

Without these parameters, it's not possible to work with DataGridPager's page size options with MudPagination.

Description

How Has This Been Tested?

Types 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)

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 enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Mar 14, 2024
@codecov
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.86%. Comparing base (28bc599) to head (75a9446).
Report is 15 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8363      +/-   ##
==========================================
+ Coverage   89.82%   89.86%   +0.03%     
==========================================
  Files         412      414       +2     
  Lines       11878    11913      +35     
  Branches     2364     2364              
==========================================
+ Hits        10670    10706      +36     
+ Misses        681      676       -5     
- Partials      527      531       +4     

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

@ScarletKuro ScarletKuro requested a review from tjscience March 14, 2024 09:31
@henon henon changed the title DataGridPager: HideNavigation DataGridPager: Add HideNavigation and HidePageNumber Mar 14, 2024
@henon
Copy link
Contributor

henon commented Mar 14, 2024

@mckaragoz In the title of the PR you wrote HideNavigation but in the code I see HidePagination which I find quite an odd name for a property on a pager ;). I guess you wanted to name it HideNavigation really?

@henon henon changed the title DataGridPager: Add HideNavigation and HidePageNumber MudDataGridPager: Add HideNavigation and HidePageNumber Mar 14, 2024
@ScarletKuro
Copy link
Member

ScarletKuro commented Mar 14, 2024

MudDataGrid is not completely compatible with MudPagination
(from discord)

Can someone explain my why and what it the benefit of using MudPagination in the PagerContent of DataGrid instead of the MudDataGridPager?
Or I'm missing some use case?
Also I'd like to see tests that content gets hidden / shown when the corresponding values are set for properties.

@mckaragoz
Copy link
Member Author

mckaragoz commented Mar 14, 2024

Can someone explain my why and what it the benefit of using MudPagination in the PagerContent of DataGrid instead of the MudDataGridPager?

MudDataGridPager can only navigate to previous or next page. But with MudPagination user can go to 5th page from 1st page directly. If a datagrid has 10 pages and you want to go 5th one, need to click next page button 4 times, which is really unnecessary.

Copy link
Contributor

@tjscience tjscience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thanks!

@ScarletKuro
Copy link
Member

A small bUnit test would be nice so we could safely merge it and not worry that it breaks in future for some reason.

@mckaragoz
Copy link
Member Author

A small bUnit test would be nice so we could safely merge it and not worry that it breaks in future for some reason.

Well how can i test this visual?

@henon
Copy link
Contributor

henon commented Mar 19, 2024

The only way is to check that the appropriate classes are applied or not applied. Should be a very simple test.

@ScarletKuro
Copy link
Member

Any update on this?

The only way is to check that the appropriate classes are applied or not applied. Should be a very simple test.

And yes, this what I basically want.
Also it got a conflict now.

@mckaragoz
Copy link
Member Author

Added test here.

@henon
Copy link
Contributor

henon commented Apr 8, 2024

Look at #8594, we are doing away with negative properties. So please rename to ShowNavigation and ShowPageNumber. The default value of the parameter and all the invocations have to be inverted of course, like I did in my PR.

@mckaragoz
Copy link
Member Author

@henon should be done now.

@henon henon changed the title MudDataGridPager: Add HideNavigation and HidePageNumber MudDataGridPager: Add ShowNavigation and ShowPageNumber Apr 11, 2024
@henon henon merged commit 5f6d5da into MudBlazor:dev Apr 11, 2024
biegehydra pushed a commit to biegehydra/MudBlazor that referenced this pull request Apr 26, 2024
@mckaragoz mckaragoz deleted the DataGridPagerHideNavigation branch January 22, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants