The onResourceExpand event handler fires in the JavaScript Scheduler when the user expands a resource tree node.
DayPilot.Scheduler.onResourceExpand(args)args.resource (DayPilot.Row) - expanded resource row
args.preventDefault() - prevents the action specified by resourceExpandHandling, but does not stop the node from expanding
Calling args.preventDefault() doesn't prevent the node from expanding. It only prevents the action specified by resourceExpandHandling, such as "PostBack" or "CallBack".
In api=1 mode, the legacy signature is onResourceExpand(resource), where resource is a DayPilot.Resource object with the following properties:
start (DayPilot.Date) - resource start (corresponds to startDate when viewType == "Resource")
name (string) - resource name
value (string) - resource ID
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onResourceExpand: (args) => {
console.log("Expanded resource", args.resource);
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onResourceExpand: (args) => {
console.log("Expanded resource", args.resource);
},
// ...
};React
<DayPilotScheduler
onResourceExpand={onResourceExpand}
{/* ... */}
/>const onResourceExpand = (args) => {
console.log("Expanded resource", args.resource);
};Vue
<DayPilotScheduler
@resourceExpand="onResourceExpand"
<!-- ... -->
/>const onResourceExpand = (args) => {
console.log("Expanded resource", args.resource);
};Resource Expand Event [doc.daypilot.org]