0
votes

I am using fullcalendar to show events present in my application.

https://fullcalendar.io/docs/event_data/Event_Source_Object/ I am using the url option of eventsource to show events from remote json url

{
    id: 1,
    url: '/myfeed.aspx',
    color: 'yellow',   // an option!
    textColor: 'black' // an option!
}

All that is fine i.e I can see events populated in my calendar via remote url.

My query is to get list if all those events in a variable so that I can control over those events later.

I want to use that url option only as event source.

Is there any method to get list of events under a particular event source in full calendar

1

1 Answers

0
votes

You can use ajax for that (jQuery example):

var myEvents = {};
$.get(
    '/myfeed.aspx',
    function(jsonResponse){
        myEvents = JSON.parse(jsonResponse);
    }
)

Depending on how exactly the json returned by myfeed.aspx is formatted (it should return the events as array of objects according to the docs) you can now directly use the content of the "myEvents" variable to assign to the event-attribute of the calender ..

{
     id: 1,
     events: myEvents,
     color: 'yellow',
     textColor: 'black'
}