Horizontal scroll of the timeline by mouse

Hello,

We setup the gantt library in our platform, so far works great.
I saw from the documentation that you can scroll the timeline by Shift + mouse wheel, which is good, but we would like also to be able to scroll it by pressing the mouse on the calendar and dragging it left / right. Can you give us some pointers on how should we approach it or if is possible ?

Thank you
Marius

Hello Marius,
It is possible to implement that using the following methods and functions:
docs.dhtmlx.com/gantt/api__gant … state.html
docs.dhtmlx.com/gantt/api__gantt_scrollto.html
docs.dhtmlx.com/gantt/api__gant … event.html

We just get the mouse position right after the click and detect how it changes. And we get the scrolling position. After that we add the difference between mouse positions to the scrolling position.
Please check the following snippet to see how it might work:
snippet.dhtmlx.com/4908dd70d

Update:
If your Gantt version is 6.3 or newer, you no longer need a custom solution as Gantt has a dedicated extension for that:
https://docs.dhtmlx.com/gantt/api__gantt_drag_timeline_config.html
Here is a sample:
https://docs.dhtmlx.com/gantt/samples/02_extensions/27_drag_timeline.html

Perfect, it works!

Thank you,
Marius