search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Adding a Color Bar using Active Areas doesn't work

Asked by Albert
2 years ago.

I'm trying the following sample (Adding a Color Bar using Active Areas):

https://doc.daypilot.org/scheduler/row-header-customization/

I've just placed the following code on my scheduler object, but nothing appears.

onBeforeRowHeaderRender: function (args) {
var color = (args.row.index % 2) ? "#cc4125" : "#e69138"; // alternating colors
args.row.areas = [
{ right: 2, top: 2, bottom: 2, width: 6, backColor: color }
];
},

Kind regards.

Answer posted by Dan Letecky [DayPilot]
2 years ago.

If you enable columns (https://doc.daypilot.org/scheduler/row-header-columns/) you need to specify the areas for the respective args.row.columns[] item instead:

onBeforeRowHeaderRender: function (args) {
  var color = (args.row.index % 2) ? "#cc4125" : "#e69138"; // alternating colors
  var last = args.row.columns.length - 1;
  args.row.columns[last].areas = [
    { right: 2, top: 2, bottom: 2, width: 6, backColor: color }
  ];
},
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.