问题
Just wondering if there is any fullcalendar jquery plugin out there which supports check-box next to event. aim is just to put some marking on completed task.
回答1:
you can always dive into the code.
I edited "slotSegHtml" function and here is the result:
http://jsfiddle.net/V1tOr/HZjVt/11/
notice the "completed" prop in the event:
{
title: 'Lunch',
start: new Date(y, m, d+1, 12, 0),
end: new Date(y, m, d+1, 14, 0),
allDay: false,
completed : true
}
回答2:
Here are two options that don't involve editing the source of fullcalendar:
Option 1: If you're just after a way to distinguish completed tasks from not-completed tasks, you don't need to modify the fullcalendar source. I've had good luck putting small icons on to fullcalendar events just using CSS:
/* Completed task */
div.fc-event.completed-task div.fc-event-inner
{
background-image: url('checkbox-icon.png');
background-position: bottom right;
background-repeat: no-repeat;
}
Then you just need to set the "className" field on the event objects to "completed-task". You can do this on the server or in JavaScript.
Option 2: If you need to so something more complex than just display a background image, you can use the "eventRender" or "eventAfterRender" callbacks that fullcalendar provides in order to manipulate the DOM elements of the event objects in any way you like (including adding checkboxes).
来源:https://stackoverflow.com/questions/11850811/jquery-fullcalendar-plugin-with-check-box