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
window.location.reload, or even on first initialization.
Usually, it is enough to call the
scrollTo methods after parsing the data.
Here are examples:
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:
The following article explains what you need to do:
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.