Gantt Scroll To not working

After Api call, I am reloading the page at the moment, and after reloading I want the page to be focused to the same task which was focused / changed before.

I tried to scroll to the gantt task directly like gantt.showTask(123). However Its not working, is there any sampe of showTask after window.location.reload, or even on first initialization.

Hello,
Usually, it is enough to call the showTask, showDate, or scrollTo methods after parsing the data.
Here are examples:
https://snippet.dhtmlx.com/64lnnx0y
https://snippet.dhtmlx.com/dldo4z4q

But if you use the autosize config, it will not work, because you need to scroll the page and not the internal element of Gantt:
https://docs.dhtmlx.com/gantt/api__gantt_showtask.html#:~:text=if%20the%20autosize%20mode%20is%20enabled

The following article explains what you need to do:
https://docs.dhtmlx.com/gantt/api__gantt_autosize_config.html

Also, Gantt doesn’t save the selected task or scroll position if you reload the page, as Gantt is a client-side library. You need to manually save that data somewhere, then load it after the page is reloaded. Then you can provide that data to Gantt, and it will scroll to the specified position.