Issue 2566: get events (as a function) not working
Status:  Done
Owner: ----
Closed:  Oct 10
Reported by subashin...@gmail.com, Sep 14, 2015
This is how i have configure the fullcalendar :

                  calendar.fullCalendar({
			height: 640,
			eventLimit: true,
			editable: false,
			header: {
				left: '',
				center: 'title',
				right: ''
			},
			monthNames: mplLocale.longMonthNames,
			monthNamesShort: mplLocale.shortMonthNames,
			dayNames: mplLocale.longDayNames,
			dayNamesShort: mplLocale.shortDayNames,
			eventClick: handleClick,
			eventResize: handleResize,
			eventDrop: handleDrop,
			weekends: getDisplayWeekends(),
			firstDay: 1,
			events: getEvents
		});

For the events, I have chosen to use the option events (as a function)

Here is my getEvents function :

function getEvents(start, end, callback) {

		widgetGlobalObj.ajaxAgendaService.getEvents(
			moment(start).format('YYYY-MM-DD[T]HH:mm:ssZZ'),
			moment(end).format('YYYY-MM-DD[T]HH:mm:ssZZ'),
			[idCommercial]
		)
		.addCallback(
			function(result) {
				var events = [];
				var tmp = [];
				for(var i in result) {
				    var item = result[i];
				   tmp .push(item);
				}
				events = JSON.stringify(tmp );
				console.log("events--------------->" + events);
				callback(events);
			}
		);
	}


The log is as follows : 

events--------------->[{"allDay":false,"backgroundColor":null,"borderColor":"#258F45","calendarId":"CFirstNotification:800","categories":null,"chair":null,"className":["crv-11"],"commercialId":800,"configurationId":0,"durationEditable":false,"editable":false,"end":"2015-09-12T16:00:00+0400","id":"DBEC18965A2C1D8B44257EBD004A4F9A","location":null,"messageErreur":"","start":"2015-09-12T15:00:00+0400","startEditable":false,"textColor":null,"title":" - WALTER _ - 26 rue de la ?? 67210 OBERNAI  - +33388956560 - Prospection - Notification visite pour WALTER _","url":"ajaxCRVAction_detail.action?onglet=110&idCompteRenduVisite=15"},{"allDay":false,"backgroundColor":null,"borderColor":"#258F45","calendarId":"CFirstNotification:800","categories":null,"chair":null,"className":["crv-8"],"commercialId":800,"configurationId":0,"durationEditable":false,"editable":false,"end":"2015-09-02T15:30:00+0400","id":"544606C855D38DE144257EB4002F58CC","location":null,"messageErreur":"","start":"2015-09-02T15:00:00+0400","startEditable":false,"textColor":null,"title":" - ABW France -       - Prospection - Notification visite pour ABW France","url":"ajaxCRVAction_detail.action?onglet=110&idCompteRenduVisite=14"}]


Still the events are not displayed :( 

Can you please help 
Oct 10, 2015
Project Member #1 adamrs...@gmail.com
This issue tracker has been shut down, so can you open a new ticket on the new issue tracker, BUT WITH A RUNNABLE DEMO of the bug?

https://github.com/fullcalendar/fullcalendar/issues

more info on runnable demo recreations:
http://fullcalendar.io/wiki/Reporting-Bugs/

Thanks!
Status: Done