Scroll to Task

3 posts, 0 answers
  1. Bhabani
    Bhabani avatar
    4 posts
    Member since:
    Sep 2018

    Posted 03 Sep Link to this post

         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. Peter Milchev
    Admin
    Peter Milchev avatar
    442 posts

    Posted 05 Sep Link to this post

    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.
  3. Bhabani
    Bhabani avatar
    4 posts
    Member since:
    Sep 2018

    Posted 05 Sep in reply to Peter Milchev Link to this post

    Thanks Peter, this works fine.

Back to Top