Hi,
I am trying to make tasks to have the same color as their parent (unless other color is provided). I am referring to your example where you implemented this: https://bryntum.com/products/gantt/examples/custom-rendering/
You extended TaskModel class and added this getter:
get eventColor() {
if (!this.get('eventColor')) {
return this.parent.eventColor;
}
return super.eventColor;
}
However in my TypeScript application I get the following error: 'eventColor' is defined as a property in class 'TaskModel', but is overridden here in 'CDSTaskModel' as an accessor.
I am not able to do it because eventColor is defined as a property. So I get around it by doing this:
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
get eventColor(): string | null {
if (!this.get('eventColor')) {
return (this.parent as any).eventColor;
}
return this.get('eventColor'); // I also needed to modify this part a little bit for it to work
}
Now it works as expected I would like to double-check if there is a better way without using @ts-ignore since it is never recommended?