Virtual scroll in Vue Gantt component

16 Mar 20235 minutes to read

Virtual Scroll support in Gantt allows you to load large amount of data without performance degradation. To enable Virtual Scrolling, you need to inject VirtualScroll module in Gantt.

Row Virtualization

Row virtualization allows you to load and render a large number of tasks in Gantt with effective performance. In this mode, all tasks are fetched initially from the datasource and rendered in the DOM within a compact viewport area.

The number of records displayed in the Gantt is determined by the height.

This mode can be enable by setting the enableVirtualization property to true.



import Vue from "vue";
import { GanttPlugin, Selection, VirtualScroll } from "@syncfusion/ej2-vue-gantt";
import{tempData} from "./datasource.js";


var virtualData = [];
var projId = 1;
for (var i = 0; i < 50; i++) {
    var x = virtualData.length + 1;
    var parent_1 = {};
    parent_1['TaskID'] = x;
    parent_1['TaskName'] = 'Project' + (projId++);
    for (var j = 0; j < tempData.length; j++) {
        var subtasks = {};
        subtasks['TaskID'] = tempData[j].TaskID + x;
        subtasks['TaskName'] = tempData[j].TaskName;
        subtasks['StartDate'] = tempData[j].StartDate;
        subtasks['Duration'] = tempData[j].Duration;
        subtasks['Progress'] = tempData[j].Progress;
        subtasks['parentID'] = tempData[j].parentID + x;

new Vue({
el: '#app',
    template: `
        <ejs-gantt ref='gantt'
            :dataSource= "data"
            :taskFields= "taskFields"
            :allowSelection= "true"
            :enableVirtualization= "true"
            :labelSettings= "labelSettings"
            :height= "height"
            :treeColumnIndex= "1"
            :highlightWeekends= "true"
            :columns= "columns"
            :splitterSettings= "splitterSettings">
data:  function() {

data : virtualData,
         taskFields: {
             id: 'TaskID',
             name: 'TaskName',
             startDate: 'StartDate',
             endDate: 'EndDate',
             duration: 'Duration',
             progress: 'Progress',
             parentID: 'parentID'
         columns: [
            { field: 'TaskID' },
             { field: 'TaskName' },
             { field: 'StartDate' },
             { field: 'Duration' },
             { field: 'Progress' }
         height: '450px',
         labelSettings: {
            taskLabel: 'Progress'
         splitterSettings: {
             columnIndex: 2
provide: {
   gantt: [ Selection, VirtualScroll]


Limitations for Virtual Scroll

  • Due to the element height limitation in browsers, the maximum number of records loaded is limited by the browser capacity.
  • Cell selection will not be persisted.
  • The number of records rendered will be determined by the height property.
  • It is necessary to mention the height of the Gantt in pixels when enabling Virtual Scrolling.
  • Virtual Scroll does not support Multi Taskbar support in Resource View.