Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144504 | May 9,2019 11:00 AM UTC | May 20,2019 10:10 AM UTC | Vue | 4 |
![]() |
Tags: Schedule |
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";
});
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.