Back to Devexpress

ASPxClientGantt.InsertResource(data, taskKeys) Method

aspnet-js-aspxclientgantt-dot-insertresource-x28-data-taskkeys-x29.md

latest1.9 KB
Original Source

ASPxClientGantt.InsertResource(data, taskKeys) Method

Inserts a new resource.

Declaration

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

Parameters

NameTypeDescription
dataany

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.

aspx
<dx:ASPxGantt ID="Gantt" runat="server" ClientInstanceName="clientGantt" >
    //...
</dx:ASPxGantt>
js
// 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

ResourceInserted

ResourceInserting

ASPxGantt - Overview

MVCxGantt - Overview

ASPxGantt - 'How To' Examples

MVCxGantt - 'How To' Examples

ASPxClientGantt Class

ASPxClientGantt Members