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

Refresh gantt datasource on server side


The webpage has a chart gantt and datepicker. When you change the date gantt chart should be refreshed with new content generated data source on the server side. 
How best to perform this operation avoiding unnecessary refresh the entire page?


3 Replies

JR John Rajaram Syncfusion Team April 24, 2015 03:58 PM UTC

Hi Robert,

Thanks for using Syncfusion product.

We have analyzed your query and prepared a sample based on your requirement for updating the new datasource in Gantt control while changing the date in the ejDatePicker control without refreshing the browser.

Please refer the following code snippets for more details.

Code snippets:


@Html.EJ().DatePicker("DatePick").ClientSideEvents(s => s.Close("onClose"))

<br />






<script type="text/javascript">

var ganttData1=@Html.Raw(Json.Encode(ViewBag.dataSource)),



function onClose(args) {

var ganttObject = $("#Gantt").data("ejGantt");


ganttObject.setModel({ dataSource: ganttData2 });




ganttObject.setModel({ dataSource: ganttData1 });






Please find the sample in the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/118926/MVCsampleSQL90336456.zip

If this is not your exact requirement, we request you to share more details regarding your queries and revert to us by modifying our sample.

Please let us know if you have any questions about this.
John R

RO RobertS April 24, 2015 06:46 PM UTC


Thank you for your example. I found some other solution that works in a similar way but allows for more 
efficient communication with the controller. Anyway thanks for the suggestion.



              // ...


        function OnStartDateChanged(args) {
            $.ajax("/Controller/RefreshData" { type: "POST", data: { date: args.value } })
              .done(function(result) {
                var ganttObject = $("#gantt").data("ejGantt");
                if (ganttObject) {
                    ganttObject.setModel({ dataSource: result.List.Data });


MK Mahalakshmi Karthikeyan Syncfusion Team April 27, 2015 10:37 AM UTC

Hi Robert,

Thanks for the update.

Yes, we can also refresh the Gantt data source in the Controller using AJAX post method.

Please let us know if you want further assistance on this.


Mahalakshmi K.

Live Chat Icon For mobile
Up arrow icon