This is a migrated thread and some comments may be shown as answers.

Scroll to Task

2 Answers 403 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Bhabani
Top achievements
Rank 1
Bhabani asked on 03 Sep 2018, 12:59 PM

     Hi,

      I have a requirement to scroll horizontally to the task when its clicked from the left side tree. This when when i select a task,  its chart will come into view.

 

I have seen a similar post which does similar job by manipulating the range. But my requirement is just to scroll the task into viewport without changing the range. 

 

Does this feature exist in current gantt chart or is there any available workaround ?

2 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 05 Sep 2018, 10:04 AM
Hello Bhabani,

This behavior can be achieved in the OnChange event by finding the task element left position and scroll the Timeline view content as demonstrated in this dojo example: http://dojo.telerik.com/ETeQArEK.

function onChange(e) {
  var gantt = e.sender;
  var selection = gantt.select();
 
  var left = $(".k-gantt-timeline [data-uid='"+ selection.attr("data-uid") +"']").closest(".k-task-wrap").css("left")
  $(".k-gantt-timeline .k-grid-content").scrollLeft(parseInt(left)-10)
}


Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Bhabani
Top achievements
Rank 1
answered on 05 Sep 2018, 10:51 AM

Thanks Peter, this works fine.

Tags
Gantt
Asked by
Bhabani
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Bhabani
Top achievements
Rank 1
Share this question
or