Premium support for our pure JavaScript UI components


Post by jit@flowit.dk »

Hi Bryntum.

We need Gantt to preserve scroll when reloading data.

preserveScroll=true and preserveScrollOnDatasetChange=true does just that - except vertical scroll is only tracked when scrolling horizontally, causing much confusion as it's sometimes the correct vertical position being restored, but often not.

scrollLeft and scrollTop is stored in state when storeScroll() is triggered.
storeScroll() is triggered when scrolling horizontally, and when manipulating cell data.
But not when scrolling vertically. This results in the "old" (last known) position being restored when data reloads.

See proof of lack of vertical scroll tracking in attached video clip.

Attachments
Bryntum-2025-01-29-011-highres.m4v
(2.63 MiB) Downloaded 11 times

Best regards
Jimmy Thomsen


Post by tasnim »

The gantt needs to be aware about the data change to preserve the scrollY. If you want to preserve the scrollY you can get it from https://bryntum.com/products/gantt/docs/api/Grid/view/GridBase#property-scrollable

msedge_GMHqkYK1wv.gif
msedge_GMHqkYK1wv.gif (2.65 MiB) Viewed 869 times

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post by jit@flowit.dk »

Hi @Tasnim.

Thanks for the suggestion.

Wouldn't it be more appropriate to fix the problem in Gantt? How does it make sense that the scroll position can be restored reliably if we interact with cells or scroll horizontally, but not when scrolling vertically? How is the concept of scroll position related to changes to data? Those are completely different things.

We use the StateProvider to ensure that state is tracked and restored. I'd rather not have to manipulate DOM and potentially cause conflicts with built-in functionality.

Please reconsider the possibility that this is a bug.

Best regards
Jimmy Thomsen


Post by tasnim »

Hi,

I wanted to kindly confirm with https://bryntum.com/products/gantt/examples/state/ demo. As it preserves the horizontal scroll, it should also preserve the vertical scroll. is this what you're referring to?

msedge_9HetS4stcf.gif
msedge_9HetS4stcf.gif (2.16 MiB) Viewed 792 times

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post by jit@flowit.dk »

@Tasnim That is actually a really good example of the problem. It works for you because state is preserved when you do HORIZONTAL scrolling. Try to only do VERTICAL scrolling, and you will see that the vertical scroll position is not restored. See attached video clip.

Bryntum-2025-02-03-008-scroll-position-not-preserved-ezgif.com-video-to-gif-converter.gif
Bryntum-2025-02-03-008-scroll-position-not-preserved-ezgif.com-video-to-gif-converter.gif (3.16 MiB) Viewed 791 times

Best regards
Jimmy Thomsen


Post by tasnim »

Thanks for confirming, we'll investigate this issue. Here is the ticket to track status https://github.com/bryntum/support/issues/10715

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post by jit@flowit.dk »

Thanks @tasnim

Best regards
Jimmy Thomsen


Post Reply