Our state of the art Gantt chart


Post by Jerther »

Hi!

In the Task editor customization demo, there is an option in the task editor to change a task's color. That works fine for ordinary tasks, but for milestones, it applies color to the square background, not the diamond shape itself.

(By the way I noticed the example uses the deprecated "tplData" parameter.)

Is there a simple way of applying the color only to the diamond shape itself?


Post by Jerther »

I see this has been answered recently, I'm just not sure if this other topic author's need was as specific:

viewtopic.php?f=51&t=13915&p=71882&hilit=milestone+color#p71882


Post by mats »

Good spot, I've opened a ticket to get this resolved: https://github.com/bryntum/support/issues/855

It won't be as straightforward as we're using a :before element for the diamond, but we'll get it fixed shortly!


Post by Jerther »

Thanks Mats,

In the meantime, I did find a workaround but that's a bit far fetched for such a simple thing. If that can help someone until your implementation:

    taskRenderer({taskRecord, renderData}) {
        if (taskRecord.color) {
            if(taskRecord.isMilestone)
                renderData.cls[`myapp-milestone-color-${taskRecord.color}`] = true;
            else
                renderData.style += `background-color:${taskRecord.color}`;
        }
...

And some CSS for every color:

.b-milestone.myapp-milestone-color-red::before {
    background-color: red !important;
}
...

I'll follow the github issue!


Post by mats »

Good you found a workaround, also opened this feature request: https://github.com/bryntum/support/issues/857


Post Reply