Let’s say I have more tasks than can be displayed onscreen. If I select a task that is off-screen using
gantt.selectTask(id)
how do I automatically scroll it into view?
(I’ve looked at the documentation and the only thing I’ve found related to scrolling is to do it to a x/y position, which isn’t a help without a way of converting the task id to an y position. And I found no hint anywhere on how to do that conversion.)
You can click on the required task in grid for displaying it on the screen.
Click on the event “Task 3.3” and it will be displayed on the screen: docs.dhtmlx.com/gantt/samples/03 … onfig.html
Hi @Srdjan_Stajic,
For now, it could be done using the getTaskPosition method, which provides the functionality, to find the task’s position on the chart. After that you will be able to move to this position using the scrollTo method, it may look like in this code fragment:
var task = gantt.getTask(id);
var sizes = gantt.getTaskPosition(task, task.planned_start, task.planned_end);
gantt.scrollTo(sizes.left, sizes.top);