Our state of the art Gantt chart


Post by bharat95 »

Hi,

When I add a new task using taskmenu, I want to display custom icon in UI for newly added task.
I'm using typescript.
Please help how i can do that?

Thanks,
Bharat


Post by tasnim »

Hi,

You could use https://bryntum.com/products/gantt/docs/api/Gantt/data/TaskStore#event-beforeAdd listener to configure the iconCls
https://bryntum.com/products/gantt/docs/api/Gantt/model/TaskModel#field-iconCls

First you need a counter outside of gantt

let counter = 0;

And then add this inside of project config

        taskStore : {
            listeners : {
                beforeAdd(event) {
                    // prevent first load
                    if (counter > 0) {
                        event.records[0].iconCls = 'b-fa-solid b-fa-coffee';
                    }
                    counter++;
                }
            }
        }
Attachments
Screenshot 2023-03-29 150515.png
Screenshot 2023-03-29 150515.png (30.31 KiB) Viewed 981 times

Post by bharat95 »

Hi,

I was able to add custom icons but alignment is not coming proper for task which have subtask. I have attached image and highlighted the issue. The name should be aligned in sequence irrespective to icons. Thanks

Attachments
Alignment issue.PNG
Alignment issue.PNG (131.89 KiB) Viewed 958 times

Post by tasnim »

Thanks for your report. I've reproduced it. Here is the ticket to track progress https://github.com/bryntum/support/issues/6563

We'll investigate it.


Post by bharat95 »

Hi,

Any updates on above bug?

Thanks,
Bharat


Post by marcio »

Hey Bharat,

Unfortunately, no updates, but I added a note to the ticket. Please watch the issue for updates. :)

Best regards,
Márcio


Post by mats »

Not sure this qualifies as a bug. The icon of the task that you add a child to maintains its icon, it sounds like you'd like that icon to be cleared? Try clearing the icon in your beforeAdd listener?

Or did I misunderstand your expectations?


Post by bharat95 »

Hi Mats,

The issue is with the alignments of icon when we add it for all task and child.


Post by alex.l »

Do you expect expand/collapse icon be replaced with your static custom icon?

All the best,
Alex


Post by bharat95 »

No,

The icon for task and child task.


Post Reply