Skip to main content
A newer version of this page is available. .
All docs
V20.2

ASPxClientGantt.InsertResource(data, taskKeys) Method

Inserts a new resource.

Declaration

InsertResource(
    data: any,
    taskKeys: any[]
): void

Parameters

Name Type Description
data any

The resource data.

taskKeys any[]

An array of tasks’ keys.

Remarks

The keys should have the same format as used in the data source fields.

// Inserts a new resource 
clientGantt.InsertResource({ Name: "New Resource" });

// Inserts a new resource with the specified color
clientGantt.InsertResource({ Name: "New Resource", Color: "Red"});

// Inserts a new resource and assigns it to an individual task
clientGantt.InsertResource({ Name: "New Resource"}, ["4"]);

// Inserts a new resource and assigns it to multiple tasks
clientGantt.InsertResource({ Name: "New Resource"}, ["4", "10"]);

Concepts

See Also