开发者

FullCalendar Events by day

I am using jquery Fullcalendar script http://arshaw.com/fullcalendar/ and I'd like to make the whole day's block clickable when there is an event on it in开发者_如何学JAVAstead of rendering the title on corresponding day's block. Is there any way to do this? Any help is greatly appreciated.


You can provide an eventRender() callback, where you modify the element's style to be render over the block.

edit: There's no relationship between the Calendar cell and the event. Even FC itself just builds an overlay over the cell when you drag an event. I suggested that you can style your element to cover the cell similar to how FC creates the overlay. If that's not what you want, you will have to tweak FC's source.

I tried this:

line 2175, add: t.getBodyCells = function() { return bodyCells };

eventRender: function(event, element, view) {
  var cell = view.dateCell(event.start);
  var colCnt = view.getColCnt();
  var bodyCell = view.getBodyCells();
  var cellElement = bodyCell[cell.row*colCnt + cell.col];
  $(cellElement).css('background-color', 'red');
}

You can now set a click event handler on the cell, and disable the event rendering.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜