Losing scroll position on render

Hi,

I have an issue where when Chart is displayed, it seems impossible to control the Grid scroll position.

If chart is not displayed, using gantt.scrollTo() and gantt.getScrollState() will work on the Grid. But if it Chart is available, gantt.scrollTo() and gantt.getScrollState() will work on the Chart and not the grid.

Doing a gantt.render() in that case will lose the scroll positions on the grid.

Any ways to prevent or fix that? I would need the scroll state of grid and a way to force scroll position.

Note: I have grid scroll enabled, therefore 2 scroll bars.

Thanks

Hello Karl,
This is expected behavior for the gantt.scrollTo method: it should work for the timeline for the vertical and horizontal scroll. When there is no timeline, Gantt will try to scroll the grid.

If you want to scroll the layout cell, you need to use the scrollLayoutCell method:
https://docs.dhtmlx.com/gantt/api__gantt_scrolllayoutcell.html

For the grid, it should look like this:

gantt.scrollLayoutCell("grid", 50,50);

Using the render method shouldn’t reset the scroll positions in the grid, unless you have the 9.0.6 or an older version as this bug was fixed in the 9.0.7 version:
https://docs.dhtmlx.com/gantt/whatsnew.html#:~:text=Prevent%20Gantt%20from%20scrolling%20to%20the%20leftmost%20position%20of%20the%20grid%20when%20clicking%20on%20a%20task

If that doesn’t help you, I need a snippet or a ready demo so that I can reproduce the issue locally.