Does anyone have an example of events (as a function) for FullCalendar
I want to use events (as a function) in my calendar. The above example specified myxmlfeed.php and using xml. I tried to add some xml but I am returning a js error. has anyone used FullCalendar this way?
http://arshaw.com/fullcalendar/docs/event_data/events_function/
a source to share
I am using FullCalendar with events as a feature on one of my client sites . The FullCalendar implementation is pretty much customizable, but below is the code I am using to load JSON data into a calendar.
<script type='text/javascript'>
$(document).ready(function() {
$('#calendar').fullCalendar({
events: function(start, end, callback) {
$.post("calendar_data.asp", {
start: start.getTime() / 1000,
end: end.getTime() / 1000,
catID: '<% Response.Write(catID) %>'
}, function(result) { callback(result) }, "json");
},
loading: function(bool) {
if (bool) $('#loading').show();
else $('#loading').hide();
},
});
});
</script>
If you mark my call $.post()
, I am passing "catID" with a request for calendar_data.asp. This is an implementation detail specific to my code; you will most likely have to tweak it for your specific requirements.
Edit
I'm not entirely sure if this will work with the most recent version of FullCalendar. It has been a while since I implemented my solution and the library has changed somewhat.
a source to share