Issue 664: pass an option to the JSON event feed
Status:  Done
Owner: ----
Closed:  Nov 2010
Reported by ryanpcha...@gmail.com, Oct 8, 2010
Hi, I am using fullCalendar with Expression Engine. I have created a php page in Expression engine that can parse the information and return it properly, but I cannot get the information dynamically. 

In order for full calendar to fetch the proper results for the page that it is on, I need to pass a variable to the JSON feed, so it can use that information, build the JSON needed, and then send the proper info back to full calendar. 

Is there a way for me to attach an option to send to the php file so it can parse the correct info and then return it to full calendar?

many thanks,

Ryan
Oct 11, 2010
#1 ryanpcha...@gmail.com
code.I was looking at the json post method. Would I use this to send the info to the php page that renders the json info?
Oct 11, 2010
#2 ryanpcha...@gmail.com
Do I need to enter events as a function to make this happen?
Oct 11, 2010
#3 ryanpcha...@gmail.com
I am trying to do the following... 

               $('#calendar').fullCalendar({
					header: {
						left: 'month,agendaWeek,agendaDay',
						center: 'title',
						right: 'prev,next today'
					},
					editable: false,
					events: ""						
					events: function(start, end, callback) {
							$.ajax({
								url: '{path=projects/cal_feed}',
								data: 'segment : {segment_3}',
								success: function(doc) {

									var events = [];

									$(doc).find('event').each(function() {
										event.push({
											title: $(this).attr('title'),
											start: $(this).attr('start') // will be parsed
										});
									});

									callback(events);
								}
							});
						}


					
				});

How would I read in the 'segment : {segment_3}' part of the data option in my php page?
Nov 10, 2010
Project Member #4 althaus.it
See the jQuery documentation for the AJAX request:

http://api.jquery.com/jQuery.ajax/

You can set any extra parameters which you then can read from $_GET/$_POST.

Nov 21, 2010
Project Member #5 adamrs...@gmail.com
looks like you need your data option like this:

data: {
   path: 'projects/cal_feed',
   segment: 'segment_3'
}

not sure though
but this problem is concerning your use of jquery, not fullcalendar itself. closing
Status: Done
Nov 21, 2010
Project Member #6 adamrs...@gmail.com
this feature <https://code.google.com/p/fullcalendar/issues/detail?id=386>, when implemented, might be of use to you