Jquery fullcalendar plugin with check-box

本小妞迷上赌 提交于 2019-12-12 12:00:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!