getTaskResources

returns the array of unique resources assigned to a specific task from the datastore

ResourceItem[] getTaskResources(string | number taskId);
taskIdstring | numberthe task id
ResourceItem[]an array of resource objects

Available only in PRO Edition

Example

gantt.getTaskResources(5); // -> see details

Related samples

Details

This functionality is available in the PRO edition only.

The getTaskResources method is not available if process_resource_assignments is disabled.

The method returns an array with resourceItem objects that have the following properties:

  • id - (string | number) - the ID of the resource item
  • open? - (boolean) - indicates whether the resource item is expanded in the tree (true) or collapsed (false)
  • parent? - (string | number) - the ID of the resource item's parent
  • text? - (string) - the resource name
  • unit? - (string) - the unit for the assignments
  • [customProperty: string] - (any) - any custom property
[
    {id: 6, text: "John", parent:1, unit: "hours/day" },
    {id: 7, text: "Mike", parent:2, unit: "hours/day" }
]
See also
Change log

added in v8.0

Back to top