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

Changing dataSource in ejGantt


I've got a question concerning datasource replacement in Gantt chart.
I aim to implement checkbox changing datasource connected to Gantt chart.
Below I attach example where I coded the solution, but every checkbox click triggers console error log (screen below).
My question is how to replace datasource or fix the console error.

Console error


3 Replies

JS Jonesherine Stephen Syncfusion Team August 4, 2017 12:54 PM UTC

Hi Karol, 
We analyzed the provided sample. In this sample data source updated in improper way. Hence the console error occurs. We have modified the sample and updated the new data by using setModel. 
Please find the code example below: 
'toolbarClick': function (args) { 
            if (args.itemName == "ToggleTaskCB") { 
                 condition = !condition; 
                 var newData = condition ? dataSource : dataSource2, // my other dataSource 
                 ganttObj = $("#gantt").ejGantt("instance"); 
                //To update new data 
                 ganttObj.setModel({ "dataSource": newData }); 
Please find the modified sample from below location 
Please let us know if you have further assistance on this. 
Jone sherine P S. 

KW Karol Wlodarek August 8, 2017 01:54 PM UTC

Thanks for reply.

It's works great.


JD Jayakumar Duraisamy Syncfusion Team August 9, 2017 04:12 AM UTC

Hi Karol, 
We are glad that your issue has been resolved. Please let us know if you need any other assistance. 
Jayakumar D 

Live Chat Icon For mobile
Up arrow icon