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.
DayPilot.Scheduler.onResourceHeaderClick(args)args.resource.start (DayPilot.Date) - resource start
args.resource.name (string) - resource name
args.resource.id (string | number) - resource ID
args.preventDefault() - cancels the default action
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 to startDate for viewType == "Resource")
name (string) - resource name
value (string) - resource ID
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);
};