new ej.buttons.CheckBox({ cssClass: 'e-resource e-airways-1', label: 'Categorize-A', checked: true, change: onChange }, '#Categorize-A');
new ej.buttons.CheckBox({ cssClass: 'e-resource e-airways-2', label: 'Categorize-B', checked: true, change: onChange }, '#Categorize-B');
new ej.buttons.CheckBox({ cssClass: 'e-resource e-airways-3', label: 'Categorize-C', checked: true, change: onChange }, '#Categorize-C');
function onChange(args) {
var ele = document.querySelectorAll('.e-resource');
var filteredData = [];
for (var i = 0; i < ele.length; i++) {
if (ele[i].getAttribute('aria-checked') === 'true') {
debugger;
var fildata = filter(ele[i].firstElementChild.children[0].id);
filteredData = filteredData.concat(fildata);
}
}
scheduleObj.eventSettings.dataSource = filteredData;
scheduleObj.dataBind();
}
function filter(id) {
var dm = new ej.data.DataManager({ json: data });
var CurData = dm.executeLocal(new ej.data.Query().where("Category", 'equal', id));
return CurData;
}
|