Angular Gantt - resources
You can add resources to a project and assign them to tasks. Resources can be people responsible for tasks, equipment, materials, etc. The Gantt displays resources as labels on the right of the tasks.
Use the dataSource option to bind the widget to a data source, which contains resources. If the field names in your data source differ from the 'id' and 'text' default names, use the keyExpr and/or textExpr options to map data fields.
See Also
- <dx-gantt ... >
- <dxo-resources
- [dataSource]="resources"
- keyExpr="resourceId"
- textExpr="title">
- </dxo-resources>
- <!-- ... -->
- </dx-gantt>
- import { Component } from '@angular/core';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent {
- resources: Resource[];
- // ...
- constructor(service: Service) {
- this.resources = service.getResources();
- // ...
- }
- }
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule } from '@angular/core';
- import { AppComponent } from './app.component';
- import { DxGanttModule } from 'devextreme-angular';
- import { Service, Resource, ... } from './app.service';
- @NgModule({
- imports: [
- BrowserModule,
- DxGanttModule
- ],
- providers: [Service],
- declarations: [AppComponent],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
- import { Injectable } from '@angular/core';
- export class Resource {
- id: number;
- text: string;
- }
- const resources: Resource[] = [{
- 'resourceId': 1,
- 'title': 'Management'
- },
- // ...
- ];
- @Injectable()
- export class Service {
- getResources(): Resource[] {
- return resources;
- }
- }
dataSource
Refer to the resources option to see how to specify the dataSource option.
If you have technical questions, please create a support ticket in the DevExpress Support Center.