The onBeforeResHeaderRender event handler fires once for every row during initialization and update, when resources are loaded. See also DayPilot.Scheduler.onBeforeRowHeaderRender, which is called on demand whenever the row header is rendered.
Declaration
DayPilot.Scheduler.onBeforeResHeaderRender(args)Parameters
args.resource.areas- active areasargs.resource.backColor- background colorargs.resource.columns- row header column propertiesargs.resource.contextMenu- context menuargs.resource.cssClass- CSS classargs.resource.expanded- expanded stateargs.resource.eventHeight- event heightargs.resource.fontColor- font color (available since 2018.2.3224)args.resource.html- custom header HTMLargs.resource.id- resource ID (read-only)args.resource.loaded- loading stateargs.resource.name- resource nameargs.resource.minHeight- minimum row heightargs.resource.marginBottom- bottom marginargs.resource.start- row start (read-only)args.resource.toolTip- tooltip text
Notes
The args.resource.columns property is an array of column properties. Item structure (available since build 8.1.2007):
htmlbackColorcssClass
The args.resource.columns[] index depends on DayPilot.Scheduler.rowHeaderColumnsMode.
Tabular mode
Since version 2019.4.4063, the Scheduler uses Tabular mode for row header columns by default.
When no columns are defined using DayPilot.Scheduler.rowHeaderColumns, the row header HTML can be set using
args.resource.html.When columns are defined, the row header HTML can only be set using
args.resource.columns[].html. The column numbers correspond to the columns defined using DayPilot.Scheduler.rowHeaderColumns. In this mode,args.resource.htmlis ignored and you need to useargs.resource.columns[0].htmlinstead.
Legacy mode
The properties of the first (default) column are controlled using
args.row. The HTML of the first column is always defined usingargs.row.html.Additional columns are available only when columns are specified using DayPilot.Scheduler.rowHeaderColumns, and they are accessible using
args.row.columns[]. That means the second column is available asargs.row.columns[0].
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onBeforeResHeaderRender: (args) => {
if (args.resource.loaded === false) {
args.resource.html += " (loaded dynamically)";
}
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onBeforeResHeaderRender: (args) => {
if (args.resource.loaded === false) {
args.resource.html += " (loaded dynamically)";
}
},
// ...
};React
<DayPilotScheduler
onBeforeResHeaderRender={onBeforeResHeaderRender}
{/* ... */}
/>const onBeforeResHeaderRender = (args) => {
if (args.resource.loaded === false) {
args.resource.html += " (loaded dynamically)";
}
};Vue
<DayPilotScheduler
@beforeResHeaderRender="onBeforeResHeaderRender"
<!-- ... -->
/>const onBeforeResHeaderRender = (args) => {
if (args.resource.loaded === false) {
args.resource.html += " (loaded dynamically)";
}
};See Also
DayPilot.Scheduler.onBeforeRowHeaderRender
DayPilot.Scheduler.rowHeaderColumnsMode
DayPilot.Scheduler.rowHeaderColumns
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot