| Issue 2434: | Easily get current Calendar context from callback methods | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I initialize two calendars on same page as below:
html
<div id="calendar1"></div>
<div id="calendar2"></div>
javascript
$("#calendar1, #calendar2").fullCalendar({
.....
events: function(start, end, timezone, callback) {
var evt1=[{title:'A',start:'2015-02-01'}];
var evt2=[{title:'B',start:'2015-02-01'}];
calendarid = $(this); <== how to get the id?
if (calendarid = 'calendar1') { callback(evt1); }
if (calendarid = 'calendar2') { callback(evt2); }
}, // end of events
.....
}
I initialize two calendars on same page as below:
html
<div id="calendar1"></div>
<div id="calendar2"></div>
javascript
$("#calendar1, #calendar2").fullCalendar({
.....
events: function(start, end, timezone, callback) {
var evt1=[{title:'A',start:'2015-02-01'}];
var evt2=[{title:'B',start:'2015-02-01'}];
calendarid = $(this); <== how to get the id?
if (calendarid = 'calendar1') { callback(evt1); }
if (calendarid = 'calendar2') { callback(evt2); }
}, // end of events
.....
}
Each calendar got its own set of events. How can I know the selector id inside the events function? Hope that fullCalendar expose the selector id in the events function(start, end, timezone, callback, calendarid) {...}
Aug 21, 2015
Discussion for this issue has moved to the following URL: https://github.com/fullcalendar/fullcalendar/issues/2699 This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event. Happy coding, Adam
Status:
ExportedToGithub
|
|
| ► Sign in to add a comment |
Status: Accepted
Labels: Type-Feature