This is the code that calculates the group availability (https://code.daypilot.org/97538/javascript-scheduler-displaying-group-availability):
onBeforeCellRender: function(args) {
if (args.cell.isParent) {
var children = dp.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;
args.cell.html = "" + available;
}
}
The "children" variable holds all child rows. You need to apply a filter to remove the admin rows.
Let's assume the admin row is marked with "admin":true like this:
resources: [
{ name: "Group", id: "G1", children: [
{ name: "Row 1", id: 1 },
{ name: "Admin row", id: 2, admin: true }
]
}
]
Then you can exclude the row like this:
onBeforeCellRender: function(args) {
if (args.cell.isParent) {
var children = dp.rows.find(args.cell.resource).children().filter(function(row) { return !row.data.admin; });
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;
args.cell.html = "" + available;
}
}
Note this line:
var children = dp.rows.find(args.cell.resource).children().filter(function(row) { return !row.data.admin; });