Skip to content

Grids - DataController: Extract scrolling knowledge to extenders - #35130

Open
bit-byte0 wants to merge 2 commits into
DevExpress:mainfrom
bit-byte0:refactor/data-controller-extract-scrolling-paging
Open

Grids - DataController: Extract scrolling knowledge to extenders#35130
bit-byte0 wants to merge 2 commits into
DevExpress:mainfrom
bit-byte0:refactor/data-controller-extract-scrolling-paging

Conversation

@bit-byte0

Copy link
Copy Markdown
Contributor

What

Moves the scrolling option knowledge out of the base grid DataController paging logic into the virtual scrolling module, so the base data layer no longer depends on scrolling

How

Base paging now delegates the paginate and total-count decisions to overridable resolvePaginate and requiresTotalCount hooks, and the scrolling option reset to optionChanged, which the virtual scrolling extender implements using its own scrolling-mode predicates

@bit-byte0
bit-byte0 requested a review from a team as a code owner September 9, 2026 13:10
Copilot AI lite review requested due to automatic review settings September 9, 2026 13:10
@bit-byte0 bit-byte0 added the 26_2 label Sep 9, 2026
@bit-byte0 bit-byte0 self-assigned this Sep 9, 2026

Copilot AI left a comment

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.

🟡 Changes recommended

The newly added test’s ExposedDataController extends DataController redeclares protected members as public, which can cause a TypeScript inheritance error and break compilation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR refactors grid paging logic so the base DataController no longer depends on scrolling options, delegating paging and total-count decisions to overridable hooks implemented by the virtual scrolling extender.

Changes:

  • Added resolvePaginate() and requiresTotalCount() hooks to DataController and routed paging decisions through them.
  • Moved scrolling-specific paging/total-count behavior into the virtual scrolling data controller extender (including handling scrolling option changes).
  • Updated unit tests by removing resolvePaginate utility coverage and adding extender-focused paging tests.
File summaries
File Description
packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/extenders/virtual_scrolling_data_controller.ts Implements paging/total-count hook overrides and handles scrolling option changes within the virtual scrolling extender.
packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/extenders/tests/virtual_scrolling_data_controller.paging.test.ts Adds new Jest coverage for virtual scrolling’s paging/total-count hook behavior and scrolling option reset behavior.
packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/paging.ts Removes resolvePaginate utility to keep paging utils independent of scrolling knowledge.
packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/tests/paging.test.ts Drops tests for the removed resolvePaginate utility, leaving syncPaging coverage.
packages/devextreme/js/__internal/grids/grid_core/data_controller/data_controller.ts Removes scrolling handling from optionChanged and introduces overridable paging/total-count hooks used by base paging logic.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 9, 2026 13:56

Copilot AI left a comment

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.

🔵 Needs a closer look

The newly added Jest test introduces a TypeScript type/visibility mismatch (widening protected hooks to public) that can break compilation.

Review details

Suppressed comments (1)

packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/extenders/tests/virtual_scrolling_data_controller.paging.test.ts:16

  • The test declares ExposedDataController extends DataController and makes resolvePaginate/requiresTotalCount public, but those hooks are protected on DataController. TypeScript will treat this as an invalid inheritance (visibility widening) and can fail compilation for the test.
declare class ExposedDataController extends DataController {
  public resolvePaginate(enabled: boolean | undefined): boolean | undefined;

  public requiresTotalCount(): boolean;
}
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@bit-byte0
bit-byte0 force-pushed the refactor/data-controller-extract-scrolling-paging branch from 6efe76f to 3ffb530 Compare September 9, 2026 14:13
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.

2 participants