简体   繁体   English

多用户错误与事件Jquery Week Calendar

[英]Multi users bug with events Jquery Week Calendar

I'm using Jquery Week Calendar plugin, and almost everything is working fine, but this: When I give my array of user names to the "users" option, it loads all users from my array BUT do not show ANY events. 我正在使用Jquery Week Calendar插件,并且几乎所有功能都可以正常工作,但这是:当我将用户名数组赋予“ users”选项时,它将从我的数组加载所有用户,但不显示任何事件。 And obviously when I disable the "users" options, all event are loaded. 很明显,当我禁用“用户”选项时,所有事件都被加载。

It seems that my user names array is having conflict with events. 看来我的用户名数组与事件冲突。

What might be happening ?? 可能会发生什么?

Let's take a look at the code: 让我们看一下代码:

Creating events: 创建事件:

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'}
  ]
};

Loading events in calendar: 在日历中加载事件:

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

Other options: 其他选项:

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,

I'm available for more details. 我可以了解更多详细信息。 Thank you all for the attention. 谢谢大家的关注。

You should assign events to users by adding userId: [id] to every event, example : 您应该分配eventsusers加入userId: [id]到每一个事件,例如:

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

That should work take a look at official demo for multi-user . 可以查看多用户的官方演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM