2012-02-07 126 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); 
    } 
} 

我不知道爲什麼,這是行不通的,但事實並非如此。有什麼想法改變什麼?

在此先感謝!

回答