The onBeforeRowHeaderRender event is fired whenever a Scheduler row header is actually rendered. If progressive row header rendering is enabled (it is enabled by default) it will happen during vertical scrolling.
Unlike onBeforeResHeaderRender (which is fired when rows are loaded from DayPilot.Scheduler.resources) this event has access to real-time row properties using DayPilot.Row object (available as args.row).
Note: Do not use the direct row modification methods of the args.row object inside onBeforeRowHeaderRender [e.g. args.row.column(0).html("new html")].
See also row header customization.
DayPilot.Scheduler.onBeforeRowHeaderRender(args)
The column index counting (args.resource.columns[]) depends on rowHeaderColumnsMode ("Tabular" or "Legacy") - see below.
Since version 2019.4.4063, the Scheduler uses Tabular mode for the row header columns by default.
Properties of the first (default) column are controlled using args.row. The HTML of the first column is always defined using args.row.html.
Additional columns (which area available only if columns are specified using rowHeaderColumns) are acessible using args.row.columns[] array. That means the second column is accessible as args.row.columns[0].
dp.onBeforeRowHeaderRender = function(args) { var hasExpanded = args.row.groups.expanded().length > 0; var hasCollapsed = args.row.groups.collapsed().length > 0; if (hasExpanded && hasCollapsed) { args.row.areas = [ {v:"Visible", right: 14, top: 0, height: 12, width: 12, style: "cursor:pointer", html: "<img src="expand.png" />", action:"JavaScript", js: function(row) { row.groups.expandAll(); } }, {v:"Visible", right: 0, top: 0, height: 12, width: 12, style: "cursor:pointer", html: "<img src="collapse.png" />", action:"JavaScript", js: function(row) { row.groups.collapseAll(); } } ]; } else if (hasCollapsed) { args.row.areas = [ {v:"Visible", right: 0, top: 0, height: 12, width: 12, style: "cursor:pointer", html: "<img src="expand.png" />", action:"JavaScript", js: function(row) { row.groups.expandAll(); } }, ]; } else if (hasExpanded) { args.row.areas = [ {v:"Visible", right: 0, top: 0, height: 12, width: 12, style: "cursor:pointer", html: "<img src="collapse.png" />", action:"JavaScript", js: function(row) { row.groups.collapseAll(); } } ]; } };