BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
onEventRendered: function(args) {
let totalEvents = this.$refs.ScheduleObj.ej2Instances.eventsData;
var dm = new DataManager({ json: totalEvents });
let resources = this.$refs.ScheduleObj.ej2Instances.resources[0]
.dataSource;
resources.forEach(function(resource) {
var hours = 0;
var datasource = dm.executeLocal(
new Query().where("person_id", "equal", resource.Id)
);
datasource.forEach(function(data) {
hours += Math.abs(data.EndTime - data.StartTime) / 36e5;
});
document.getElementById(resource.Id).innerHTML = hours + " Hours";
});
},
ondataBinding: function(args) {
if (args.result.length == 0) { // This function is to update the resource header when last event is deleted in Schedule
let resources = this.$refs.ScheduleObj.ej2Instances.resources[0]
.dataSource;
resources.forEach(function(resource) {
document.getElementById(resource.Id).innerHTML = 0 + " Hours";
});
}
} |