Custom HTML in a day with FullCalendar?
Is there a way to add, specifically, form elements for every day that are distinguishable per day? Below is an example.
I know FullCalendar is built to handle "Events", so from what I can tell in the docs, it's not really possible. But I'm not a Javascript guru either, so would anyone else know of a solution? I'm hoping to no开发者_如何学Ct have to reinvent the wheel.
That's an interesting idea which I haven't attempted yet. I don't think there is a callback like onRenderDay(), so you'll probably have to hack it in there. I'd suggest adding your code into the viewDisplay
callback. Something like this maybe:
$('#calendar').fullCalendar({
viewDisplay: function(view) {
$("#calendar .fc-view-month td").append('<input type="checkbox"/>AM<br>');
}
});
You may need to tweak the selector, perhaps use .fc-grid
. You could also customize it to not include <td>
elements with a class of .fc-other-month
, so that only actual days of the currently viewed month will have the extra content in them and not days from the previous or next month that are in this month's view.
I'm assuming that any events will overlap on top of your content, so this might all be for naught anyway. Unless you aren't going to show events, in which case you could probably solve this better without fullcalendar.
Also, your image looks like you want just a single week to show. I don't thin that is possible with fullcalendar. Besides, if that is what you want, there would be much simpler ways to do it than using fullcalendar.
Good luck!
精彩评论