Q:

Multiple eventsources with jquery FullCalendar

I know there are a few examples of how to use multiple feed sources with FullCalendar, ie:
Stackoverflow post
Plugin Docs
However, none of them show how to use multiple feed sources with additional ajax info such as type, data, etc.
I am trying to use multiple feed sources but can't get it to work. Here is my code:
eventSources: [
    'json-schedule.php',
    'json-events.php'
],

    type: 'POST',
    data: {
        //  custom_param1: 'something', 
    },
    error: function() {
        alert('there was an error while fetching events!');
    },
    success: function() {
    },

Where does the type, data, error & success parts go with more than one data source? None of the examples I've found show that.

A:

Try this way:
$('#calendar').fullCalendar({
    ...
    eventSources: [
        // your JSON event source
        {
            url: '/myfeed.php', // use the `url` property
            color: 'yellow',    // an option!
            textColor: 'black'  // an option!
        },

        // your ajax event source
        {
            events: function(start, end, callback) {
                $.ajax({
                    url: 'myxmlfeed.php',
                    dataType: 'xml',
                    data: {
                        // our hypothetical feed requires UNIX timestamps
                        start: Math.round(start.getTime() / 1000),
                        end: Math.round(end.getTime() / 1000)
                    },
                    success: function(doc) {
                        var events = [];
                        $(doc).find('event').each(function() {
                        events.push({
                            title: $(this).attr('title'),
                            start: $(this).attr('start') // will be parsed
                        });
                    }
                });
            }
        }
    ],
    ...
});

