The onBeforeRowHeaderRender event handler allows customization of the row headers in the JavaScript Gantt Chart component.
DayPilot.Gantt.onBeforeRowHeaderRender(args)
args.task (DayPilot.Task)
args.row.html (string)
args.row.backColor (string)
args.row.columns (array, see below)
args.row.cssClass (string)
args.row.toolTip (string)
args.row.contextMenu (DayPilot.Menu object or the variable name)
args.row.areas (array) - for object structure see DayPilot.Area properties
The columns property is available only when Gantt row header columns are defined. It is an array, indexed from 0. Column object structure:
areas - array of active areas
backColor (string) - background color
cssClass (string) - custom CSS class
horizontalAlignment ("left" | "right" | "center")
html (string) - row header column HTML
text (string) - used for image export or if html is not specified
If columns are defined, the args.row.html value is ignored - use args.row.columns[0].html instead.
As of DayPilot Pro for JavaScript 7.9 SP1 this event is fired in real time (whenever the row is rendered) and the following properties are not available:
args.row.expanded
args.row.minHeight (integer)
args.row.marginBottom (integer)
You need to define them in the task data if you want to use them.
gantt.onBeforeRowHeaderRender = function(args) {
var duration = new DayPilot.TimeSpan(args.task.end().getTime() - args.task.start().getTime());
var html = duration.toString("d") + "d " + duration.toString("h") + "h";
args.row.columns[2].html = html;
};