2012-02-07 125 views
0

全部, 我使用fullcalendar下载中的示例,但是我想使用fullcalendar.js而不是fullcalendar.min.js。当我做出这个改变时,虽然选择选项不起作用(我无法选择任何时间范围,弹出窗口也没有出现)。如果使用fullcalendar.js而不是fullcalendar.min.js,FullCalendar Select不起作用

任何想法必须改变fullcalender.js文件,使其工作?

编辑我用下面的代码为我的选择:

selectable: true, 
selectHelper: true, 
select: function(start, end, allDay) { 
    var title = prompt('Event Title:'); 
    calendar.fullCalendar('unselect'); 
}, 

编辑#2这个问题似乎是与selectHelper。如果我注释掉那部分,我可以选择我想使用的时间,但它没有很好的覆盖。下面是从fullcalendar.js执行此代码:

function renderSlotSelection(startDate, endDate) { 
    var helperOption = opt('selectHelper'); 
    coordinateGrid.build(); 
    if (helperOption) { 
     var col = dayDiff(startDate, t.visStart) * dis + dit; 
     if (col >= 0 && col < colCnt) { // only works when times are on same day 
      var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only for horizontal coords 
      var top = timePosition(startDate, startDate); 
      var bottom = timePosition(startDate, endDate); 
      if (bottom > top) { // protect against selections that are entirely before or after visible range 
       rect.top = top; 
       rect.height = bottom - top; 
       rect.left += 2; 
       rect.width -= 5; 
       if ($.isFunction(helperOption)) { 
        var helperRes = helperOption(startDate, endDate); 
        if (helperRes) { 
         rect.position = 'absolute'; 
         rect.zIndex = 8; 
         selectionHelper = $(helperRes) 
          .css(rect) 
          .appendTo(slotContent); 
        } 
       }else{ 
        rect.isStart = true; // conside rect a "seg" now 
        rect.isEnd = true; // 
        selectionHelper = $(slotSegHtml(
         { 
          title: '', 
          start: startDate, 
          end: endDate, 
          className: ['fc-select-helper'], 
          editable: false 
         }, 
         rect 
        )); 
        selectionHelper.css('opacity', opt('dragOpacity')); 
       } 
       if (selectionHelper) { 
        slotBind(selectionHelper); 
        slotContent.append(selectionHelper); 
        setOuterWidth(selectionHelper, rect.width, true); // needs to be after appended 
        setOuterHeight(selectionHelper, rect.height, true); 
       } 
      } 
     } 
    }else{ 
     renderSlotOverlay(startDate, endDate); 
    } 
} 

我不知道为什么,这是行不通的,但事实并非如此。有什么想法改变什么?

在此先感谢!

回答