October 23, 2020, 09:18:28 AM

See more Support incidents in our old archived forum.

Author Topic: Scroll gantt chart  (Read 2580 times)

phillip.dutton

  • Customers
  • Newbie
  • *
  • Posts: 3
Scroll gantt chart
« 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.

phillip.dutton

  • Customers
  • Newbie
  • *
  • Posts: 3
Re: Scroll gantt chart
« Reply #1 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. :)

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
Re: Scroll gantt chart
« Reply #2 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 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.