Using Ajax Call in Calendar
Hi Guys, I have the following code, to get a list of data from a web service call and put them into a calendar. I tried debugging it and the data returns fine ... but it's the rendering part which I am not sure how to get it working. So what I am trying to do is loop through this data and put them into a string list and then put that list into the calendar call. Can anyone see what's wrong with this?
$.get('/WebServices/HttpHandler.ashx?action=GETMATCHES&year=2014', function (results) {
if (results.Errors) {
alert('Unexpected error: ' + results.Errors[0].Message);
}
else {
var rowData;
var data = results.Data;
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
var e = data[i];
rowData += "{" +
"title: '" + e.Title+ "', " +
"start: new Date(y,m,12)" +
"}<br />";
}
}
$('#calendar').fullCalendar({
editable: true,
events: [
rowData
]
});
}
});