The onResourceExpand event handler fires in the JavaScript Scheduler when the user expands a resource tree node.
Declaration
DayPilot.Scheduler.onResourceExpand(args)Parameters
args.resource(DayPilot.Row) - expanded resource rowargs.preventDefault()- prevents the action specified by resourceExpandHandling, but does not stop the node from expanding
Notes
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 tostartDatewhenviewType == "Resource")name(string) - resource namevalue(string) - resource ID
Examples
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);
};See Also
Resource Expand Event [doc.daypilot.org]
DayPilot.Scheduler.resourceExpandHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot