Page 1 of 1

Is it possible to change 'on the fly' the avatars img for the names in the resourceassigment column?

Posted: Mon Jan 30, 2023 3:06 pm
by agarcia

Hi,
I'm trying to change o the fly the avatars of the resourceassigment column.

Is it possible to switch between names and avatrs? if so, could you tell me how can apply it?

Thank you in advance


Re: Is it possible to change 'on the fly' the avatars img for the names in the resourceassigment column?

Posted: Mon Jan 30, 2023 3:26 pm
by tasnim

Yes, Of course. You could use https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#property-resources to set new data of resources

Here is a gif of the output


Re: Is it possible to change 'on the fly' the avatars img for the names in the resourceassigment column?

Posted: Mon Jan 30, 2023 4:40 pm
by agarcia

Thank you Tasnim.
My question was more about the way the resources are displayed on the column cell. In your example I see how you change the resources data dynamicaly, but the resources are always displayed as avatar (Image). What I would like to do is just to change the way the resources are displayed on the cells. Removing the images and getting the names, and then return to the avatar images.

How I could do that?

Thank you


Re: Is it possible to change 'on the fly' the avatars img for the names in the resourceassigment column?

Posted: Mon Jan 30, 2023 4:59 pm
by tasnim

Hello,

Then you could set image or imageUrl in the resource to null.

gantt.project.resourceStore.forEach(item => { item.image = null; });

https://bryntum.com/products/gantt/docs/api/Gantt/model/ResourceModel#field-image
https://bryntum.com/products/gantt/docs/api/Gantt/model/ResourceModel#field-imageUrl

Is this what you're looking for


Re: Is it possible to change 'on the fly' the avatars img for the names in the resourceassigment column?

Posted: Mon Jan 30, 2023 5:54 pm
by agarcia

Thank Tasnim,
I will test this out.

Have a nice day