The "Fullcalendar" plugin for jQuery sends two parameters ("start" and "end") as form parameters via POST requests, which are not well processed by ASP.net WebServices (version >=3.5), which are expecting a well-formed JSON.
The result of the asp.net webmethod is a JSON object nested in the property "d" of another JSON object. This sintax is not understandable by Fullcalendar.
To solve these problems just edit fullcalendar.js changing _fetchEventSource function:
Note: JSON.stringify() is a function from the json2.js library.
The result of the asp.net webmethod is a JSON object nested in the property "d" of another JSON object. This sintax is not understandable by Fullcalendar.
To solve these problems just edit fullcalendar.js changing _fetchEventSource function:
[...]
$.ajax($.extend({}, ajaxDefaults, source, {
data: JSON.stringify(data), // -- Line changed
success: function(events) {
//events = events || []; -- Line commented
events = events.d; // -- Line added
[...]
Note: JSON.stringify() is a function from the json2.js library.
No comments:
Post a Comment