Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/datagrid-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- We added a "Custom row key" property in the Advanced section to provide stable row identifiers when using view entities, preventing scroll position loss during data refresh.

### Fixed

- We fixed an issue where the scrollbar disappeared in virtual scrolling mode after hiding a column.

## [3.9.0] - 2026-03-23

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export const Pagination = observer(function Pagination(): ReactNode {
canNextPage={paging.hasMoreItems}
canPreviousPage={paging.currentPage !== 0}
gotoPage={page => paging.setPage(page)}
nextPage={() => paging.setPage(n => n + 1)}
nextPage={() => paging.setPage((n: number) => n + 1)}
numberOfItems={paging.totalCount}
page={paging.currentPage}
pageSize={paging.pageSize}
showPagingButtons={paging.showPagingButtons}
previousPage={() => paging.setPage(n => n - 1)}
previousPage={() => paging.setPage((n: number) => n - 1)}
pagination={paging.pagination}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const WidgetFooter = observer(function WidgetFooter(): ReactElement | nul
<div className="widget-datagrid-pb-middle">
<button
className="btn btn-primary widget-datagrid-load-more"
onClick={() => paging.setPage(n => n + 1)}
onClick={() => paging.setPage((n: number) => n + 1)}
tabIndex={0}
>
{loadMoreButtonCaption}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ const _01_coreBindings: BindingGroup = {
DG.exportProgressService,
SA_TOKENS.selectionDialogVM
);
injected(GridSizeStore, CORE.atoms.hasMoreItems, DG.paginationConfig, DG.setPageAction, DG.pageSize);
injected(
GridSizeStore,
CORE.atoms.hasMoreItems,
DG.paginationConfig,
DG.setPageAction,
DG.pageSize,
CORE.atoms.visibleColumnsCount
);
},
define(container: Container) {
container.bind(DG.basicDate).toInstance(GridBasicData).inSingletonScope();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ export class GridSizeStore {
gridContainerHeight?: number;

private lockedAtPageSize?: number;
private lockedAtColumnCount?: number;

constructor(
private readonly hasMoreItemsAtom: ComputedAtom<boolean | undefined>,
private readonly paginationConfig: PaginationConfig,
private readonly setPageAction: SetPageAction,
private readonly pageSizeAtom: ComputedAtom<number>
private readonly pageSizeAtom: ComputedAtom<number>,
private readonly visibleColumnsCountAtom: ComputedAtom<number>
) {
makeAutoObservable<GridSizeStore, "lockedAtPageSize">(this, {
makeAutoObservable<GridSizeStore, "lockedAtPageSize" | "lockedAtColumnCount">(this, {
gridContainerRef: false,
gridBodyRef: false,
gridHeaderRef: false,
lockedAtPageSize: false,
lockedAtColumnCount: false,

gridContainerHeight: observable,
lockGridContainerHeight: action
Expand Down Expand Up @@ -88,6 +91,14 @@ export class GridSizeStore {
this.lockedAtPageSize = undefined;
}

// Reset the locked height when visible column count changes so layout
// is recomputed for the new column widths (rows may reflow).
const currentColumnCount = this.visibleColumnsCountAtom.get();
if (this.gridContainerHeight !== undefined && this.lockedAtColumnCount !== currentColumnCount) {
this.gridContainerHeight = undefined;
this.lockedAtColumnCount = undefined;
}

const gridContainer = this.gridContainerRef.current;
if (!gridContainer || this.gridContainerHeight !== undefined) {
return;
Expand All @@ -112,5 +123,6 @@ export class GridSizeStore {
const overflows = gridContainer.scrollHeight > fullHeight;
this.gridContainerHeight = fullHeight - (overflows ? 0 : VIRTUAL_SCROLLING_OFFSET);
this.lockedAtPageSize = currentPageSize;
this.lockedAtColumnCount = this.visibleColumnsCountAtom.get();
}
}
Loading