Hi Alejandro,
We are happy that our solutions are fulfilling your requirements.
We have prepared the below sample for your requirement, kindly try it.
onClick(): void {
var items = document.getElementsByName('calendar');
var selectedItems = [];
for (var i = 1; i < items.length; i++) {
if ((items[i] as any).type == 'checkbox' && (items[i] as any).checked == true)
selectedItems.push((items[i] as any).value);
} this.scheduleObj.resourceCollection[0].dataSource = [];
for (var i = 0; i < selectedItems.length; i++) {
this.scheduleObj.addResource(this.calendarCollections[selectedItems[i] - 1], 'Calendars', (this.calendarCollections[selectedItems[i] - 1] as any).CalendarId);
}
}
onChange(args: ChangeEventArgs): void {
let value: number = parseInt((<Element>args.event.target).getAttribute('value'), 10);
let resourceData: Object[] =
this.calendarCollections.filter((calendar: { [key: string]: Object }) => calendar.CalendarId === value);
var a = document.querySelector('#resource');
if (args.checked) {
a.innerHTML = a.innerHTML + ',' + JSON.stringify(resourceData[0])
}
else {
a.innerHTML = a.innerHTML.replace(JSON.stringify(resourceData[0]), '');
}
}
Regards,
Karthi