Update record but avoid server side changes

Hi,

We have a usage scenario where a task is modified externally, that is not using a Gantt chart. We'd like the taskbar to reflect these changes. However, I couldn't find a proper way of doing so without sending the updated data to a server. updateRecordByID() that I tried saves the changes to the server which we want to avoid. So after tha texternal change we have to refresh the whole Gantt chart which is an overkill.

So my question is, is it possible to update start and end dates of a taskbar using a method similar to updateRecordByID() but only locally, that is without saving the chanegs to the server?

Thanks. 

1 Reply 1 reply marked as answer

PP Pooja Priya Krishna Moorthy Syncfusion Team June 8, 2020 08:49 AM UTC

Hi Dmitry, 
Yes, it is possible to update the record without saving the changes to the server side. 
If you don’t want to update the changes in server side in all the cases, then don’t define batchUrl while defining dataSource property. If you don’t want to update in certain cases alone then pass empty string to the batchUrl of dataSource as like below code example. 
 
clickHandler() { 
   var data = { taskID: 3, startDate: new Date('02/06/2017'), duration: 5 }; 
   this.ganttInstance.dataSource.dataSource.batchUrl = ''; 
   this.ganttInstance.updateRecordByID(data); 
} 
<ButtonComponent onClick={this.clickHandler.bind(this)}>Update Record</ButtonComponent> 
 
 
Please find the below sample link. 
 
Regards, 
Pooja K. 


Marked as answer
Loader.
Up arrow icon