agente_secreto
agente_secreto

Reputation: 8079

Jquery Fullcalendar: is it possible to make it render the events inside the days?

By default, fullcalendar prints the calendar table, and then the events (in a totally separate div). Then, the events are positioned on screen so they appear to be inside their corresponding day.

For very specific reasons, I need the events to be rendered inside the days ( I am working with single day events only). Is this possible?

Or at least, is there anyway to corelate events with their respective day on the calendar ( so I can work with each event and its day in a JQuery statement?

Upvotes: 2

Views: 815

Answers (1)

Piotr Kula
Piotr Kula

Reputation: 9811

Yea you can determine the day clicked with some clever jquery and javascript

Look here for a good live example

http://jsfiddle.net/ppumkin/xCHLn/

The engine is this part

 eventClick: function(calEvent, jsEvent, view) {
           var mousex = jsEvent.pageX;
           var mousey = jsEvent.pageY;
           $('td').each(function(index) {
            var offset = $(this).offset();
            if ((offset.left + $(this).outerWidth()) > mousex && offset.left < mousex && (offset.top + $(this).outerHeight()) > mousey && offset.top < mousey) {
             //Some specifics in here- look at example

Upvotes: 1

Related Questions