问题
I am working on trying to implement Full Calendar via a JSON feed. I am having issues getting the data to derive from a nested object:
Data:
[{"id":22,"weeks":[{"title":"Testing New Filter","start":"2015-01-19","end":"2015-01-29","url":"http://localhost:3000/campaigns/testing-new-filter"},{"title":"Not this Feed","start":"2015-02-24","end":"2015-03-07","url":"http://localhost:3000/campaigns/not-this-feed"}]},{"id":23,"weeks":[]}]
Calendar Implementation:
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
url: parser.pathname + '.json',
error: function() {
alert('there was an error while fetching events!');
},
color: 'yellow', // a non-ajax option
textColor: 'black' // a non-ajax option
}
// any other sources...
]
});
Stuck on how I get the data to pull from the 'weeks' start which is the child element
来源:https://stackoverflow.com/questions/28555275/full-calendar-access-dates-via-nested-json-feed