Resource assignment

Hello,

I would like to know that is there any way to assign a task to multiple resources with various assignment type.

As an example:
If the task duration is 3 days then we assign 2, 5 and 8 hours for the first, second and third days for a resource.
There may be some other resources in system.

Thank you

Hello,
There is no built-in solution for that.
You can show anything in the resource cell using conditions and returning different values:
http://snippet.dhtmlx.com/f9c542e2f
But the resource grid and the resource timeline do not share the values, so you will need to implement your own solution to calculate the total amount of hours.

Update:
Starting from the 7.1 version, you can set different resource values for different days.
Here is a sample:
https://docs.dhtmlx.com/gantt/samples/11_resources/13_resource_assignments_for_days.html

Hey ramil I saw your snippet and have a question:
Is it possible to show data in the resource grid which is not connected to the task on top?

I need to calculate the resources from another source than the tasks and don’t know how to implement it.

Hello Patrik,
Yes, you can show any data and any HTML element in the resource cell. To do that, you need to use the resource_cell_value template:
https://docs.dhtmlx.com/gantt/api__gantt_resource_cell_value_template.html
Here is an example of how it might work:

http://snippet.dhtmlx.com/5/ad37a758e

Please, note that it is better to move the calculations outside that template as the values might change every time Gantt updates the chart. For example, you can move any task in the timeline and you will see that the values in the resource chart are updated.

Hi Ramil

Thanks for your reply, I tried that, unfortunally that does not work if there is no tasks for that user on that day, see:
http://snippet.dhtmlx.com/c7ebbf549

“Test” doesn’t show up for the users Bill & Floe. I need something to fill the resource table with other data than the tasks above.

Hello Patrik,
In that case, you can enable resource_render_empty_cells property:
https://docs.dhtmlx.com/gantt/api__gantt_resource_render_empty_cells_config.html
It will allow showing all cells for all resources:
http://snippet.dhtmlx.com/5/54224dad1

exactly what I was looking for, thank you ramil, you saved my day :slight_smile: