RadiantQ Forum

Product => jQuery Gantt Package => Topic started by: phillip.dutton on September 26, 2014, 04:27:25 PM

Title: Scroll gantt chart
Post by: phillip.dutton on September 26, 2014, 04:27:25 PM
Hi,

It is possible to programmatically scroll the gantt chart?

For example, when I select a row in the in the grid I want to be able to scroll the task into view.

Thanks.
Title: Re: Scroll gantt chart
Post by: phillip.dutton on September 29, 2014, 09:14:47 AM
It's ok, I've found the GetScrollableElement() method that gets me a handle to the scrollbar on the Gantt chart and then I can use scrollLeft to set the position. :)
Title: Re: Scroll gantt chart
Post by: Rajagopal on September 29, 2014, 02:49:24 PM
phillip.dutton,

You can scroll to particular time using our GanttChart's "BringTimeIntoView" method. You may interest on our BrowseToTasksCues button feature. Please take a look at our http://www.demos.radiantq.com/jQueryGanttDemo/Samples/GanttTaskBarBrowseToCue.htm (http://www.demos.radiantq.com/jQueryGanttDemo/Samples/GanttTaskBarBrowseToCue.htm) sample for more information.

Use the below code, if you have to scroll to task's start time when its selected.
Code: [Select]
$gantt_container.GanttControl({
    SelectionChanged: function (sender, args) {
        var activityView = ganttControl.SelectedItem;
        if (activityView == null)
            return;
        var start = activityView.activity.StartTime;
        ganttControl.GetGanttChartInstance().BringTimeIntoView(start);
    }
});

Regards,
-Raja.