In my project, I’m using the gantt + resource view. The gantt view is showing different tasks for one particular project. In the resource view, I can then see all the assignments to those tasks.
However, resources have other assignments, associated to another project task (not visible at this moment, not event loaded), or even not associated to tasks (“days off” for example). I’d like to be able to show those assignments in the resource view.
Here is a view of what I’m trying to implement :
Hello Nickeau,
Gantt doesn’t have a built-in way to show task bars in the resource panel. You need to manually implement that. There is the resource_cell_value template where you can return any HTML elements and they will be displayed in the resource timeline cells: https://docs.dhtmlx.com/gantt/api__gantt_resource_cell_value_template.html
Here is an example of how to show the task bars in the resource timeline:
However, Gantt synchronizes resource assignments with tasks. If you load assignments in the parse method and the relevant tasks don’t exist, the assignments will be removed. If you do that after the data is parsed, you will get errors that the relevant tasks don’t exist.
So, you cannot rely on the built-in functionality of resource assignments to show custom elements. You need to load assignments of non-existing tasks separately.
I already managed to show task bars quite the way I want in the resource panel, using resource_cell_value as you mentioned (still some vertical alignment improvements to do when multiple assignments in one day, not that simple).
Thanks a million for the provided example. The way I have to implement this functionality is now clear for me.
Thanks again!
1 Like
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan