Passing DataManager using offline JSON datasource causes error onSave() on Gantt Component

I tried creating a DataManager using a JSON SelfReferenceData the following line.

const data = new DataManager({ json: SelfReferenceData });

The UI Renders well but unfortunately the onSave of the Dialog Edit seems to fail. Is this expected behavior? I just want to verify if this is intended, a limitation or a bug since I couldn't see this limitation mentioned in the documentation. See sandbox link for source code.



1 Reply

MS Monisha Sivanthilingam Syncfusion Team July 26, 2021 10:04 AM UTC

Hi Gil, 
 
Greetings from Syncfusion support. 
 
We have analyzed the sample you sent and would like to inform you of a few points. Whenever, we use DataManager to pass data to the Gantt Chart, we also need to define the BatchSave method in order to perform CRUD operations. Not defining the BatchSave method is the reason why you are facing the error you reported. By using BatchUrl property of DataManager, we can communicate with the controller method to update the data source on CRUD operation. In gantt CRUD actions on task are dependent with other tasks. For example on editing the child record on chart side, corresponding parent item also will get affect and predecessor dependency task as well get affected. So in Gantt all the CRUD operations are considered to be batch editing where you will get all the affected records as collection. The following code snippets demonstrate the solution. 
 
Index.js 
 
this.dataSource = new DataManager({ 
  url: 'https://localhost:44379/Home/UrlDatasource', 
  adaptor: new JsonAdaptor(), 
  crossDomain: true, 
  batchUrl: 'https://localhost:44379/Home/BatchUpdate' 
}); 
 
 
Please refer the below Online Documentation link to learn more about this. 
 
 
We have also prepared a sample for your reference. 
 
Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 


Loader.
Up arrow icon