Our state of the art Gantt chart


Post by skonakanchi »

Hi Team,

I would like to add bg-color to stages based on status.I did some code but not working. Please provide a suggestion. below is my code snippet.

--in .ts file
for (let i = 0; i < taskRecord.data.children.length; i++) {
      if (taskRecord.data.children[i].isActiveStage && taskRecord.data.children[i].rowType === 'phase') {
        renderData.cls[`b-status-${taskRecord.data.children[i].rowType}-${taskRecord.data.children[i].isActiveStage}`] =
          true;
        
} else if (!taskRecord.data.children[i].isActiveStage && taskRecord.data.children[i].rowType === 'phase') { renderData.cls[`b-status-${taskRecord.data.children[i].rowType}-false`] = true; } } --.css file .b-gantt-task-parent:not(.b-milestone-wrap) .b-gantt-task.b-status-phase-true { background-color: #287da1 !important; } .b-gantt-task-parent:not(.b-milestone-wrap) .b-gantt-task.b-status-phase-false { background-color: yellow !important; }
Attachments
bg-clr.PNG
bg-clr.PNG (109.67 KiB) Viewed 73 times

Post by alex.l »

Hi,

Please give us more information - what exactly are you doing, what do you see, what do you expect to see, how to reproduce that?

Does the code fragment provided above in taskRenderer?
No need to go throw children records, renderer will be called for every record, for children also.
Remember to switch back enabled class when it's not pass your check. Now I see you only enable it.

All the best,
Alex


Post Reply