In the first time the project run, it alway return 0 for "used" variable; If i change the view, then come back first view, it will render and caculate used?
onBeforeCellRender: args => {
if (args.cell.isParent) {
var children = this.scheduler.control.rows.find(args.cell.resource).children();
var total = children.length;
var used = children.filter(function(row) { return !!row.events.forRange(args.cell.start, args.cell.end).length; } ).length;
var available = total - used;
var color = "white"
var w = this.cellWidth / total;
args.cell.properties.areas = [];
args.cell.properties.areas.push({
html: "" + used,
// style: "text-align: center; font-size: 12px; font-weight: bold",
top: 0,
left: 0,
right: 0,
bottom: 0,
backColor: color
});
}
},