| Issue 414: | "json" will not work on "agendaWeek" | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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
Mar 30, 2010
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 |