| Issue 373: | I can't get the agendaWeek or agendaDay views to work | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I have download 1.4.5. I have the month view showing events. I have
linked it up to an Ajax query and this work. I can get the basicDay and
basicWeek views to work, but I can't get the agendaDay or agendaWeek views
to work. I have put a lot of debug code and I can't figure it out. It
seems to be running through the changeView fine, but I can't figure out
where it is not doing it right.
I have added some code in the click event and it shows that I have all of
the event objects. So I am not sure what I am doing wrong. I am using all
of the jquery files that came with the download.
Here is my code that I use to put the div on the page and link it up to
fullcalendar.
thanks, dan
<script type='text/javascript'>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
dayClick: function(date, allDay, jsEvent, view) {
x = $('#calendar').fullCalendar( 'clientEvents');
alert(x.length);
$('#calendar').fullCalendar( 'changeView', 'basicWeek' );
// for (i=0; i<x.length; i++) {
// alert ("Start " + x[i].start + " - End " + x[i].end);
// }
$('#calendar').fullCalendar('reRenderEvents');
if (allDay) {
alert('Clicked on the entire day: ' + date);
}else{
alert('Clicked on the slot: ' + date);
}
alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
alert('Current view: ' + view.name);
// change the day's background color just for fun
$(this).css('background-color', 'red');
},
eventClick: function(calEvent, jsEvent, view) {
alert('Event: ' + calEvent.title + ' - id ' + calEvent.id);
alert('Start: ' + calEvent.start + ' End: ' + calEvent.end)
// change the border color just for fun
$(this).css('border-color', 'red');
},
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
allDaySlot: false,
editable: true,
events: '<%= calendar2_data_path() %>',
year: <%=@start_date.year%>,
month: <%=@start_date.month-1%>,
date: <%=@start_date.day%>,
defaultView: 'month',
firstDay: 1,
minTime: 8,
maxTime: 23,
firstHour: 12,
});
});
</script>
<div id='calendar'>calendar div here</div>
Mar 15, 2010
Project Member
#1
adamrs...@gmail.com
Status:
Done
|
|
| ► Sign in to add a comment |