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

Reload Data with DataManagerUrl

i like to reload the Gantt-Data on a java-script event.
I use Datamanager.Url in the Datasource
Is there a function where i can say to the gantt control to reload the data ?

with best regards from Austria
Peter Rosenstein

1 Reply

PP Pooja Priya Krishna Moorthy Syncfusion Team November 19, 2019 09:53 AM UTC

Hi Peter, 
Greetings from Syncfusion support. 
In Gantt, we can dynamically change the data source by directly assigning the new data to the dataSource property. We prepared a sample, in which Gantt is loaded initially, with the data fetched from the server using DataManager support. On Button click, we had dynamically updated the Gantt with newly fetched data from the server using dataSource property. Please find the below code example. 
<button onclick="reloadData()">Reload data</button> 
function reloadData() { 
   var obj = document.getElementById("Gantt").ej2_instances[0]; 
   var newData = new ej.data.DataManager({ 
            url: '/Home/reloadData', 
            adaptor: new ej.data.UrlAdaptor, 
            crossDomain: true, 
   obj.dataSource = newData; 
Please get back to us if you require further assistance on this. 
Note: We have removed bin and obj folder in the provided sample for security reasons. 
Pooja Priya K. 

Live Chat Icon For mobile
Up arrow icon