Our state of the art Gantt chart


Post by ionelabebeselea13 »

Hello,

I have added a new item on the Task Context Menu but I also want to add a custom icon to the element.

How can I do that?

Thank you.


Post by alex.l »

Please check the docs here https://bryntum.com/docs/gantt/api/Core/widget/Menu

    items      : [
        {
            icon : 'b-icon b-icon-add',
            text : 'Add'
        },

All the best,
Alex


Post by ionelabebeselea13 »

Yes, but those are icons from Font Awesome. I have a custom icon that I want to add.


Post by marcio »

Hey ionelabebeselea13,

You can check the guides for custom font icons here https://bryntum.com/docs/gantt/guide/Grid/customization/iconfont

But also you can set up the content property with some icon, like this (it's a workaround, you probably will need some CSS for align correctly):

const menu = new Menu({
    items    : [
        {
            icon: '',
            content: '<i class="custom-class">Custom icon</i>',
        }
    ]
});

Best regards,
Márcio


Post by ionelabebeselea13 »

Thank you! I have managed to find a way that works.


Post Reply