this.data = [{
Id: 1,
Subject: 'Testing-1',
StartTime: new Date(2018, 1, 14, 10, 0),
EndTime: new Date(2018, 1, 14, 12, 30),
IsCustomBlock: true,
AllowBooking: false
}, {
Id: 2,
Subject: 'Testing-2',
StartTime: new Date(2018, 1, 15, 10, 0),
EndTime: new Date(2018, 1, 15, 12, 30),
IsCustomBlock: true,
AllowBooking: true
}]; onDataBound() {
if (this.flag) {
var appointments = this.scheduleObj.eventsData;
for (var i = 0; i < appointments.length; i++) {
if (appointments[i].AllowBooking) {
appointments[i].IsReadonly = false;
} else {
appointments[i].IsReadonly = true;
}
}
this.flag = false;
}
}
onEventRendered(args) {
if (args.data.IsCustomBlock) {
args.element.classList.add('custom');
}
}
onPopupOpen(args) {
if (args.target.classList.contains('custom') && !args.data.AllowBooking) {
args.cancel = true;
}
} |