1

私は 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,

詳しくはお問い合わせください。ご清聴ありがとうございました。

4

1 に答える 1

1

すべてのイベントに追加eventsしてに割り当てる必要があります。例:usersuserId: [id]

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

multi-user の公式デモを見てください。

于 2015-07-23T19:43:42.700 に答える