Skip to content

DataGrid - Pager - Show correct pageIndex when virtualScrolling is enabled on pageSize change#33412

Open
Tucchhaa wants to merge 3 commits intoDevExpress:26_1from
Tucchhaa:fix_grid_pager_26_1
Open

DataGrid - Pager - Show correct pageIndex when virtualScrolling is enabled on pageSize change#33412
Tucchhaa wants to merge 3 commits intoDevExpress:26_1from
Tucchhaa:fix_grid_pager_26_1

Conversation

@Tucchhaa
Copy link
Copy Markdown
Contributor

No description provided.

@Tucchhaa Tucchhaa force-pushed the fix_grid_pager_26_1 branch from 0b6a17d to 664a129 Compare April 27, 2026 10:05
@Tucchhaa Tucchhaa marked this pull request as ready for review April 28, 2026 10:37
Copilot AI review requested due to automatic review settings April 28, 2026 10:37
@Tucchhaa Tucchhaa requested a review from a team as a code owner April 28, 2026 10:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes DataGrid pager’s displayed page index when switching the page size to “all” (internally pageSize = 0) while virtual scrolling is enabled, ensuring the pager info shows a valid “Page 1 of 1 …” state.

Changes:

  • Adjust pager page index calculation to handle pageSize === 0 (the “all items” mode).
  • Add a TestCafe e2e regression test covering the virtual-scrolling + pageSize “all” scenario.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/devextreme/js/__internal/grids/grid_core/pager/m_pager.ts Ensures pager’s 1-based pageIndex is correct when pageSize is set to 0 (“all”).
e2e/testcafe-devextreme/tests/dataGrid/common/pager.ts Adds regression test verifying pager info becomes “Page 1 of 1 …” after switching to “all” with virtual scrolling.

@@ -9,6 +9,10 @@ const PAGER_CLASS = 'pager';
export const MAX_PAGES_COUNT = 10;

const getPageIndex = function (dataController) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This function is used to get visible index of the current page, that is passed to pager so it could display it.

If in pager the pageSize 'all' is selected, then dataController.pageSize() == 0, and so there's only one page.

export const MAX_PAGES_COUNT = 10;

const getPageIndex = function (dataController) {
if (dataController.pageSize() === 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This lines may confuse later, I think it should be fixed on pageIndex level instead
like changePaging in data controller resets pageIndex to 0 in case of pageSize = 0, same should be here, also you may notice that after changing to pageSize = All grid shows 1st page (rows from 1), not keeps the prev one

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants