My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 414: "json" will not work on "agendaWeek"
1 person starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  ----
Closed:  Mar 2010


Sign in to add a comment
 
Reported by happytur...@gmail.com, Mar 21, 2010
I have tried looking on website and in the documentation but I have found
nothing.

Listed below is the code I am using:

<link rel='stylesheet' type='text/css' href='fullcalendar/fullcalendar.css'
media="all" />
<script type='text/javascript' src='fullcalendar/jquery/jquery.js'></script>
<script type='text/javascript' src='fullcalendar/jquery/ui.core.js'></script>
<script type='text/javascript'
src='fullcalendar/jquery/ui.draggable.js'></script>
<script type='text/javascript'
src='fullcalendar/jquery/ui.resizable.js'></script>
<script type='text/javascript' src='fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript'>

	$(document).ready(function() {
	
		$('#calendar').fullCalendar({
		
			editable: false,
			weekends: false,
			allDaySlot: false,
			allDayDefault: false,
			slotMinutes: 15,
			firstHour: 8,
			minTime: 8,
			maxTime: 17,
			height: 600,
			defaultView: 'agendaWeek',
			
			events: function(start, end, callback) {
			$.ajax({
				url: 'myxmlfeed.php',
				dataType: 'xml',
				data: {
					// our hypothetical feed requires UNIX timestamps
					start: Math.round(start.getTime() / 1000),
					end: Math.round(end.getTime() / 1000)
				},
				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);
				}
			});
			},

			
			loading: function(bool) {
				if (bool) $('#loading').show();
				else $('#loading').hide();
			}
			
		});
		
	});

</script>

The JSON:

<?php
	echo json_encode(array(
		
		array(
			'id' => 35,
			'start' => "1269264600",
			'end' => "1269275400",
			'title' => "35",
			'body' => "",
			'multi' => 0,
			'allDay' => false,
			'extension_id' => 2
		)
	
	));
?>

If anyone can help me please let me know.

Mar 30, 2010
#1 naunaud...@gmail.com
Shouldn't you use
dataType: 'json' ?
Mar 30, 2010
Project Member #2 adamrs...@gmail.com
you are mixing up json and xml. please just following this article:
http://arshaw.com/fullcalendar/docs/event_data/events_json_feed/
you wont need to do any parsing if you stay in json only
Status: Done
Sign in to add a comment

Powered by Google Project Hosting