Set the vertical scroll position

In Gantt it is possible to set the vertical scroller position dynamically in button click using setScrollTop public method.

The following code example explains how to set the scroll position at button click.

  • javascript
  • <button onclick="setScrollTop()">Change scroll position</button>
    <div id="gantt" style="height:450px;width:700px"></div>
    <script type="text/javascript">
        $("#gantt").ejGantt({});
    
        function setScrollTop() {
            var ganttObj = $("#gantt").data("ejGantt");
            ganttObj.setScrollTop(50);
        }
    </script>