resource_cell_value
info
This functionality is available in the PRO edition only.
Description
Defines the HTML content of resource timeline cells
resource_cell_value: (start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]) => string | number | void;
Parameters
start_date- (required) Date - start date of the scale cellend_date- (required) Date - end date of the scale cellresource- (required) object - the resource objecttasks- (required) Array - <Task> tasks that are assigned to specified resource and overlap start/end dates of the cellassignments- (required) array - resource assignments that are assigned to the specified start/end dates of the task
Returns
html- (string | number | void) - an HTML string which will be inserted into cell's innerHTML
Example
gantt.templates.resource_cell_value = function(start_date, end_date, resource, tasks,
assignments){
return "<div>" + tasks.length * 8 + "</div>";
};
Related samples
- Resource load diagram
- Templates of the Resource diagram
- Assign multiple owners to a task
- Work and material resources
Details
note
The "assignments" argument is only awailable when the process_resource_assignments config is enabled.
- Defines the HTML content of resource timeline cells.
- Resource timeline links tasks to a resource by the resource_property property of the task object.
- The template is not called for cells where no tasks are located, unless resource_render_empty_cells is enabled.
- Tasks of the project type are not counted and won't be passed to the
tasksargument.
Related API
Related Guides
Change log
- the assignments parameter is added in v7.1