2015-11-01 59 views
0

我正在嘗試使用fullcalendar.js中的eventConstraint功能,該功能與已創建的事件完美協作。 我的問題是如何限制新事件?fullcalendar.js選擇約束

我正在考慮讓'selectable'爲false,並使用eventMouseover和eventMouseout分別將其設置爲true/false時,它將鼠標懸停在約束性背景事件上。但問題是這兩個回調不會在後臺事件中觸發。

回答

0

您應該使用select contraint方法。它的工作原理是「eventContraint」你已經使用完全相同的:

{ 
    start: '10:00', // a start time (10am in this example) 
    end: '18:00', // an end time (6pm in this example) 

    dow: [ 1, 2, 3, 4 ] 
    // days of week. an array of zero-based day of week integers (0=Sunday) 
    // (Monday-Thursday in this example) 
} 

請記住,如文檔說:

僅適用於能夠選擇的選項被激活。

這將禁止用戶在約束中用一個不錯的遊標創建新的事件。

+0

哇,我很抱歉 我不知道我是如何錯過這個。 我的編碼真的很晚。 – david