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

Gantt: onBeforeTaskRender cssClass not working

Asked by Steve Fisher
7 years ago.

I am trying to add a class to tasks that are about to be rendered, following this guide:

https://api.daypilot.org/daypilot-task-data/

dp.onBeforeTaskRender = function(args) {
args.data.cssClass = "test";
};

I am expecting the class to be added to gantt_default_event but nothing appears to happen.

This is occurring in a fresh download of the latest version (both jQuery and Angular). I only had time to test it in Chrome 54.

Thanks!

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

You need to specify the CSS class for either the row header (args.data.row.cssClass) or for the task box in the grid (args.data.box.cssClass). In the Gantt chart, args.data.cssClass doesn't exist:

dp.onBeforeTaskRender = function(args) { 
  args.data.box.cssClass = "test"; 
  args.data.row.cssClass = "test"; 
};
Comment posted by Steve Fisher
7 years ago.

Thanks!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.