Skip to content

Grids: type virtual scrolling - #36065

Merged
bit-byte0 merged 13 commits into
DevExpress:mainfrom
bit-byte0:refactor/type-virtual-scrolling-main
Oct 30, 2026
Merged

bit-byte0 merged 13 commits into
DevExpress:mainfrom
bit-byte0:refactor/type-virtual-scrolling-main

Conversation

@bit-byte0

Copy link
Copy Markdown
Contributor

What

Typed DataGrid and TreeList virtual scrolling: fields, params, return types

How

Data source adapter calls the virtual scroll controller directly instead of a string proxy. Rows view reaches the data controller through typed extension interfaces, rendered-view directives became guards, unused rows view members removed

@bit-byte0 bit-byte0 added the 26_2 label Oct 30, 2026
@bit-byte0 bit-byte0 self-assigned this Oct 30, 2026
@bit-byte0
bit-byte0 marked this pull request as ready for review October 30, 2026 11:50
@bit-byte0
bit-byte0 requested a review from a team as a code owner October 30, 2026 11:50
Comment on lines +58 to +72
if (
beginPageIndex < 0
|| (
(
that.viewportSize() >= 0
&& that.getViewportItemIndex() >= 0
&& (
beginPageIndex * that.pageSize() > that.getViewportItemIndex()
|| beginPageIndex * that.pageSize() + that.itemsCount()
< that.getViewportItemIndex() + that.viewportSize()
)
)
&& that._dataSource.isLoading()
)
) {

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.

make it more readable, please, by introducing variables

clearTimeout(this._resizeTimeout);
public dispose(): void {
super.dispose();
clearTimeout(this._resizeTimeout ?? undefined);

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.

suggestion: can we use undefined instead of null for cleared _resizeTimeout value and remove this ??

this._lastTime = new Date();
} else {
result = super.resize.apply(this);
result = super.resize();

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.

lets use early returns instead of mutations

// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
return super._needUpdateRowHeight.apply(this, arguments as any) || (itemsCount > 0
&& (isInfiniteMode(this) && !gridCoreUtils.isVirtualRowRendering(this))
protected _needUpdateRowHeight(itemsCount: number): boolean | undefined {

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.

is undefined value meaningful here or we can make it to return boolean always?

Comment on lines +41 to +42
const isVirtualMode = (that: VirtualScrollController): boolean => that.option('scrolling.mode') === SCROLLING_MODE_VIRTUAL || that.isVirtual();
const isAppendMode = (that: VirtualScrollController): boolean => that.option('scrolling.mode') === SCROLLING_MODE_INFINITE && !that.isVirtual();

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.

those should be methods or take as arguments scrollingMode and isVirtual -- if not fixed with common utils (see card follow ups section)

anna-shakhova
anna-shakhova previously approved these changes Oct 30, 2026
@bit-byte0
bit-byte0 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into DevExpress:main with commit f51e167 Oct 30, 2026
265 of 273 checks passed
@bit-byte0
bit-byte0 deleted the refactor/type-virtual-scrolling-main branch October 30, 2026 16:00
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