Hi Dan,
So I tried using the
dp.events.list = [ ... ];
, but the events are not being added? This is my code:
function mapAndAddBookingEvents(bookingArgs, flatten) {
var bookings = flatten ? _.map(bookingArgs, 'Bookings') : bookingArgs;
var mappedEvents = _.map(flatten ? _.flattenDeep(bookings) : bookingArgs,
function (item) {
var e = {
start: new DayPilot.Date(item.FromDate.format(appConfig.alternativeDateFormat))
.addHours(vm.config.businessBeginsHour),
end: new DayPilot.Date(item.ToDate.format(appConfig.alternativeDateFormat))
.addHours(vm.config.businessEndsHour),
id: item.Id,
resource: item.ResourceID,
text: item.Description,
bubbleHtml: 'Hours: ' + item.Hours,
meta: item
};
return e;
});
vm.scheduler.events.list = [];
_.forEach(mappedEvents, function (value) {
vm.scheduler.events.list.push(value);
});
vm.scheduler.update();
vm.config.ventHoverHandling = 'Bubble';
}
Can you perhaps spot what I'm doing wrong?
Thanks again!
Richard