The onResourceHeaderClick event handler fires when the user clicks a resource header in the legacy Scheduler API, before the default action. Use onRowClick for new code.
Declaration
DayPilot.Scheduler.onResourceHeaderClick(args)Parameters
args.resource.start(DayPilot.Date) - resource startargs.resource.name(string) - resource nameargs.resource.id(string | number) - resource IDargs.preventDefault()- cancels the default action
Notes
This event is obsolete and has been replaced by onRowClick.
In api=1 mode, the legacy signature is onResourceHeaderClick(resource).
DayPilot.Resource is a simple class with three properties:
start(DayPilot.Date) - resource start (corresponds tostartDateforviewType == "Resource")name(string) - resource namevalue(string) - resource ID
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onResourceHeaderClick: (args) => {
console.log("Resource:", args.resource.name);
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onResourceHeaderClick: (args) => {
console.log("Resource:", args.resource.name);
},
// ...
};React
<DayPilotScheduler
onResourceHeaderClick={onResourceHeaderClick}
{/* ... */}
/>const onResourceHeaderClick = (args) => {
console.log("Resource:", args.resource.name);
};Vue
<DayPilotScheduler
@resourceHeaderClick="onResourceHeaderClick"
<!-- ... -->
/>const onResourceHeaderClick = (args) => {
console.log("Resource:", args.resource.name);
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot