How to load data when scroll the bar

We have more than 4000 pieces of data.
We want to load the data in pages by listening to the scroll bar,so,how to do with Dhtmlx-gantt? thx

One of the options is to use onGanttScroll handler to load the tasks when you scroll to the last rendered task: ;
You can get the number of tasks visible on the screen (those that are not collapsed) by getVisibleTaskCount method: ;
and when the scroll reaches the last task, you can parse/load the data.
To prevent scrolling Gantt to the top when you parse/load the data, you can memorize the scroll position by getScrollState method: ;
and return it after parse/load with scrollTo method: ;
Please check the example of how it might be implemented:

1 Like