My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 483: AddEventSource Not Working
1 person starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  ----
Closed:  Jun 2010


Sign in to add a comment
 
Reported by crosenb...@gmail.com, May 11, 2010
I am adding events via a coldfusion cfc, that supplies the data, in correct 
format, I believe.

It successfully returns data, there are no javascript or jquery errors.

I have a function that get's the data, upon clicking on a list of possible 
sources of data, I wish to display in the calendar.

When I click it does load the data, but it does not appear anywhere in the 
calendar...

	function 
addEventSource(assigned_courses,available_classes,forums,blog) {
		// create feed url that can be used globally
		<cfoutput>
		var dataString = 'assigned_courses=' + assigned_courses + 
'&available_classes=' + available_classes + '&forums=' + forums + '&blog=' 
+ blog + '&company_id=#session.company_id#&user_id=#session.user_id#';
		</cfoutput>

		// do ajax call
		$.ajax({
			type: "GET",
			url: "/scripts/cfc/events.cfc?
method=controller&returnformat=json",
			data: dataString,
			success: function(response){

				// add ajax data to calendar events data 
object
				
$('#calendar').fullCalendar('renderEvent',response,true);

			}
		});

		// re-render after they are loaded
		$('#calendar').fullCalendar( 'refetchEvents' );

		// list events
		listEvents();
	}

I have tried to create a function that would list all the current events in 
memory, but it display's nothing...


	function listEvents() {
		// remove div if it exists
		$('#show_events').remove();

		// add div to inside calendar div
		$('#calendar').append("<div id='show_events'></div>");

		// add ul to div
		$('#show_events').append('<ul>');

		// list all events into the specific div
		var event = $('#calendar').fullCalendar('clientEvents');

		// loop thru array
		$.each(event, function(index, value) {

			// get title
			title = event[index];

			// get start
			start = event[start];

			// get end
			end = event[end];

			// add li element
			$('#show_events').append('<li>'+title+' ' + start + 
' to ' + end + '</li>');

		});

		// add ul to div
		$('#show_events').append('</ul>');


	}
How can i properly debug or diagnose what is wrong with the data being 
getted? Is there a better or easier way to display current event data?

Just to clarify I have two problems:

1. Making sure AddEventSource is correctly getting correctly formatted data 
to be added to the Calendar Event Object

2. To help diagnose the lack of anything appearing on the calendar, I need 
a way to see the current event data, in perhaps a list format.

Thank You..
addEventSource_Problems.png
27.5 KB   View   Download
Jun 16, 2010
Project Member #1 adamrs...@gmail.com
i never actually see you make a call to fullcalendar's addEventSource (you are calling renderEvent instead, which looks incorrect). use this method:
http://arshaw.com/fullcalendar/docs/event_data/addEventSource/

also, the "response" you are getting from the ajax call looks like text. won't work, needs to be an array of calevent objects.

these problems are not related to fullcalendar. good luck
Status: Done
Sign in to add a comment

Powered by Google Project Hosting