DayPilot.Scheduler.onBeforeRowHeaderRender

This event is fired whenever the row header is actually rendered. If progressive row header rendering is enabled (by default) it will happen during vertical scrolling.

Unlike onBeforeResHeaderRender (which is fired when rows are loaded from .resources) this event has access to real-time row properties using DayPilot.Row object (available as args.row).

Declaration

DayPilot.Scheduler.onBeforeRowHeaderRender(args)

Parameters

  • args.row (DayPilot.Row) object with additional properties (listed below)
  • args.row.html
  • args.row.cssClass
  • args.row.toolTip
  • args.row.contextMenu
  • args.row.moveDisabled
  • args.row.areas
  • args.row.columns
  • args.row.columns[x].html
  • args.row.columns[x].backColor
  • args.row.columns[x].cssClass
  • args.row.columns[x].areas (since 8.3.2720)

Example

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(); } }
      ];
  }
};

Demo

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java