We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Node.js fetch data from gantt chart without it being rendered.

On the backend of our application we would like to pass in a list of data and let the Gantt chart schedule it for us and then send back the scheduled JSON. Is there anyway to do this is node.js without rendering the actual Gantt chart?

Thank you!


const ganttObj = new gantt.Gantt({

  dataSource: dataManager,

  renderBaseline: true,

  dataStateChange,

  taskFields: {

    id: 'taskId',

    name: 'taskName',

    startDate: 'startDate',

    endDate: 'endDate',

    duration: 'duration',

    expandState: 'isExpanded',

    child: 'children',

    dependency: 'predecessor',

  },

  timelineSettings: {

    timelineViewMode: 'Month',

  },

  treeColumnIndex: 1,

  },

});



console.log(ganttObj.flatData)

Essentially this in node.js​



1 Reply

MS Monisha Sivanthilingam Syncfusion Team December 13, 2022 09:40 AM UTC

Hi John,


Greetings from Syncfusion support.


We cannot perform the necessary calculations required for scheduling without rendering the Gantt Chart. However, we can hide the Gantt Chart using CSS. Then, you can pass the data to the Gantt Chart and then get the processed data from the Gant Chart’s dataBound event.


Index.hml

 

<style>

  #DefaultFunctionalities {

    display: none;

  }

</style>

 


Indes.ts

 

dataBound: function(args) {

  console.log(gantt.dataSource);

}

 


Sample: https://stackblitz.com/edit/gypnuv?file=index.html,index.ts


Regards,

Monisha.


Loader.
Live Chat Icon For mobile
Up arrow icon