簡體   English   中英

多用戶錯誤與事件Jquery Week Calendar

[英]Multi users bug with events Jquery Week Calendar

我正在使用Jquery Week Calendar插件,並且幾乎所有功能都可以正常工作,但這是:當我將用戶名數組賦予“ users”選項時,它將從我的數組加載所有用戶,但不顯示任何事件。 很明顯,當我禁用“用戶”選項時,所有事件都被加載。

看來我的用戶名數組與事件沖突。

可能會發生什么?

讓我們看一下代碼:

創建事件:

var eventData1 = {
    options: {
    timeslotsPerHour: 4,
    timeslotHeight: 20,
    showAsSeparateUsers: true
  },
  events : [
     {'id':1, 'start': new Date(year22, month22, day22, 12), 'end': new Date(year22, month22, day22, 13, 30),'title':'Lunch with Mike'},
     {'id':2, 'start': new Date(year22, month22, day22, 14), 'end': new Date(year22, month22, day22, 14, 45),'title':'Dev Meeting'},
     {'id':3, 'start': new Date(year22, month22, day22 + 1, 18), 'end': new Date(year22, month22, day22 + 1, 18, 45),'title':'Hair cut'},
     {'id':4, 'start': new Date(year22, month22, day22 - 1, 8), 'end': new Date(year22, month22, day22 - 1, 9, 30),'title':'Team breakfast'},
     {'id':5, 'start': new Date(year22, month22, day22 + 1, 14), 'end': new Date(year22, month22, day22 + 1, 15),'title':'Product showcase'}
  ]
};

在日歷中加載事件:

    data: function(start, end, callback) {
      console.log(eventData1);
      callback(eventData1);
    }

其他選項:

users: usersWs, // user names array
showAsSeparateUsers: true,
displayOddEven: true,
displayFreeBusys: false,
displayEvents: true,
allowCalEventOverlap: true,
businessHours : {start: 7, end: 23, limitDisplay: true},
firstDayOfWeek : 1,
daysToShow: 6,

我可以了解更多詳細信息。 謝謝大家的關注。

您應該分配eventsusers加入userId: [id]到每一個事件,例如:

events : [
     {'id':1, 'start': ..., 'end': ...,'title':'Lunch with Mike', userId: [id]},
     {'id':2, 'start': ..., 'end': ...,'title':'Dev Meeting', userId: , userId: [id]},
     ...
]

可以查看多用戶的官方演示

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM