Skip to main content

getTaskResources

info

This functionality is available in the PRO edition only.

Description

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

getTaskResources: (taskId: string | number) => ResourceItem[]

Parameters

  • taskId - (required) string | number - the task id

Returns

  • param - (ResourceItem[]) - an array of resource objects

Example

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

Details

note

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" }
]

Change log

  • added in v8.0