1

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. 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.

Daniel Serretti
  • 242
  • 2
  • 3
  • 14
  • i just tried it. In the official documentation, when it create an event, it passes only id, start, end and title parameters. https://github.com/themouette/jquery-week-calendar – Daniel Serretti Jul 23 '15 at 19:10
  • you can see here that they pass also the userId [jquery-week-calendar/weekcalendar_demo_3.html](https://github.com/themouette/jquery-week-calendar/blob/2e4fae3cc97962cb3b618082fc7e3e00dc99bc53/weekcalendar_demo_3.html) – Zakaria Acharki Jul 23 '15 at 19:15
  • WOW!! I just miss that example, i will try it and give a return here, just a sec... – Daniel Serretti Jul 23 '15 at 19:18

1 Answers1

1

You should assign events to users by adding userId: [id] to every event, example :

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.

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101