Our state of the art Gantt chart


Post by licjapodaca »

Hi there, I would like to know how to customize the resourceassignment column content, I already tried to use the renderer function without successs, the renderer function never triggers ...

I want to show the Avatar/Initials + the resource name as plain text at the side of the avatar/initials in the resourceassignment column ... how can I accomplish that?

I use Gantt v4.2.6

Regards


Post by sergey.maltsev »

Hi!

You may use this config
https://www.bryntum.com/docs/gantt/#Gantt/column/ResourceAssignmentColumn#config-itemTpl

Something like this:

columns : [
    { type : 'name', width : 250 },
    {
        type    : 'resourceassignment',
        itemTpl : (assignment) => {
            const { resource } = assignment;
            return `<div class="b-resource-avatar b-resource-initials">${resource.initials}</div> ${resource.name}`;
        }
    }
],

Also you may use your own classes for initials avatar styling.
Please note that itemTpl doesn't work with https://www.bryntum.com/docs/gantt/#Gantt/column/ResourceAssignmentColumn#config-showAvatars config set to true

I've created this feature request issue for ability to customize ResourceAssignmentColumn
https://github.com/bryntum/support/issues/3446


Post by licjapodaca »

Thanks @sergey.maltsev for this workaround, it works 👍🏻 ...

Regards


Post Reply