2014-03-27 18 views
3

我使用完整的calendar.i創建議程事件管理,我希望根據事件位置的數量將日視圖分割爲多列。我靜態分裂,但我需要動態拆分。我的代碼靜態分裂如給出的波紋管。我動態地在多列中分割Fullcalendar視圖的單一日期

$(document).ready(function() { 
    var date = new Date(); 
    var d = date.getDate(); 
    var m = date.getMonth(); 
    var y = date.getFullYear(); 

    $('#calendar').fullCalendar({ 
    header: { 
    left: 'prev,next today', 
    center: 'title', 
    right: 'resourceDay' 
    }, 
    defaultView: 'resourceDay', 
    resources: [ 
    { 
     /* 
     * employeeId 
     * name 
     * backgroundColor 
     * foregroundColor 
     */ 
     id: '1', 
     name: 'Joe Bloggs', 
     color: 'red', 
     textColor: 'black' 
    }, 
    { 
     id: '2', 
     name: 'Alan Black', 
     color: 'blue' 
    }, 
    { 
     id: '3', 
     name: 'Robert White', 
     color: 'pink' 
    }, 
    { 
     id: '4', 
     name: 'Paul Green', 
     color: 'green' 
    }, 
    { 
     id: '5', 
     name: 'Jane Yellow', 
     color: 'yellow', 
     textColor: 'black' 
    } 
    ], 
    events: [ 
    { 
      title: 'Test Event', 
     start: '2014-03-27 12:30:00', 
     end: '2014-03-28 17:10:00', 
     resources: '4', 
     allDay: false 

      } 
     ], 
    }); 


    }); 
</script> 

<div id='calendar'></div> 

上面的代碼工作正常,但我想給動態資源值。 請幫我..

回答