Data Binding / DataManager with WebApiAdaptor - no data?

Hi there,
I'm getting started with Syncfusion and the Schedule widget.

For the test I created a simple test page with the following script:

var dataManager = new ej.data.DataManager({
    url: 'http://myURL',
    adaptor: new ej.data.WebApiAdaptor,
});

var scheduleObj = new ej.schedule.Schedule({
    height: '550px',
    selectedDate: new Date(2020, 01, 19),
    eventSettings: { dataSource: dataManager
    },
   actionFailure: function() {
    var span = document.createElement('span');
    scheduleObj.element.parentNode.insertBefore(span, scheduleObj.element);
    span.style.color = '#FF0000'
    span.innerHTML = 'Server exception: 404 Not found';
 },
 dataBound: function(e){
    console.log("DATA BOUND...");
    console.log(e);
},
dataBinding: function(e){
    console.log("DATA BINDING...");
    console.log(e);
}

});
scheduleObj.appendTo('#schedule');


The response of myURL is follow:
{"Items":[{"Id":1,"StartTime":"2020-02-19T18:30:00","Endtime":"2020-02-19T19:30:00","Subject":"TEST1"},{"Id":2,"StartTime":"2020-02-20T08:30:00","Endtime":"2020-02-20T09:30:00","Subject":"TEST2"},{"Id":3,"StartTime":"2020-02-21T18:30:00","Endtime":"2020-02-21T19:30:00","Subject":"TEST3"}],"Count":3}


But my console output is follow:


No event is displayed in the scheduler. Before I used the WebApiAdaptor, I tested the scheduler with the JavaScript var based data binding.

Where is my mistake?

Thanks for your help!



3 Replies

MA Mark February 19, 2020 09:45 PM UTC

Endtime needs to be EndTime - would be my guess.  I just started as you did and this was my problem.  Using Fields[] did not work for me either, so I made sure my end point is returning the field names exactly as they show in the API docs.


CH chrisschd February 19, 2020 10:12 PM UTC

Thanks, this was my mistake ... :(


VM Vengatesh Maniraj Syncfusion Team February 20, 2020 05:24 AM UTC

Hi Christian,  
 
Greetings from Syncfusion Support. 
 
We are happy that you have found the solution. 
 
Please let us know if you need any other assistance. 
 
Regards, 
Vengatesh.  


Loader.
Up arrow icon