As you can see from the snippet, the start/end is determined automatically by the library, and the library has determined that there is no reason to scroll.
However, I want to have infinite scroll so the user can move forward/backward in the timeline area even if their tasks fit into the bounds.
The onGanttScroll event does not fire in this case. I want the user to always be able to scroll in the timeline, even if there are no tasks. How can I accomplish this?
Hello,
Please take a look at the following article: How-tos Gantt Docs where you can see how to implement infinite scroll. You will also find a ready-made example there.
In addition, I notice that in the recommend infinite scroll code from your documentation, because the āonGanttScrollā is called so many times it blows out the scales and its easy to end up with scale that is like 100000+ pixels wide which kills performance, understandably.
I tried to make a window, and Iām wondering if you have any suggestions for making the interaction more fluid. I have to set a reasonable delay like 200ms, otherwise it is either too jarring or too slow.
please comment out the āonParseā event code to see the issue
If I comment out the onParse handler in your example, then allowInfiniteScroll is set to false, which causes onGanttScroll to exit early due to this condition:
gantt.attachEvent("onGanttScroll", () => {
if (!allowInfiniteScroll) return;
In addition, I notice that in the recommend infinite scroll code from your documentation, because the āonGanttScrollā is called so many times it blows out the scales and its easy to end up with scale that is like 100000+ pixels wide which kills performance, understandably.
I tried to make a window, and Iām wondering if you have any suggestions for making the interaction more fluid. I have to set a reasonable delay like 200ms, otherwise it is either too jarring or too slow.
After reviewing your code, I understand that youāve already taken the main steps to improve performance. Unfortunately, at this point, there is no way to make the infinite scrolling smoother.
1 Like
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan