Hello,
But when I changed to CRUD actions the appointments doesn't hide when you uncheck the resource . How can I do that with CRUD
This is the onChange of the checkboxes:
function onChange() {
var scheduleObj = document.getElementById('schedule').ej2_instances[0];
var ownerOneObj = document.getElementById('emv').ej2_instances[0];
var ownerTwoObj = document.getElementById('apo').ej2_instances[0];
var ownerThreeObj = document.getElementById('pat').ej2_instances[0];
var predicate;
var checkBoxes = [ownerOneObj, ownerTwoObj, ownerThreeObj];
checkBoxes.forEach(function (checkBoxObj) {
if (checkBoxObj.checked) {
if (predicate) {
predicate = predicate.or('CalendarId', 'equal', parseInt(checkBoxObj.value, 10));
} else {
predicate = new ej.data.Predicate('CalendarId', 'equal', parseInt(checkBoxObj.value, 10));
}
}
});
scheduleObj.eventSettings.query = new ej.data.Query().where(predicate);
}
I've also added the sample
Attachment:
scheduler_with_database_c9cd93b9.rar