-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
40 lines (39 loc) · 1.32 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from 'react';
import './App.css';
import { GanttComponent, TaskFieldsModel, ColumnsDirective, ColumnDirective, Edit, Inject,
Toolbar, Selection } from '@syncfusion/ej2-react-gantt';
import { projectData } from './data';
function App() {
const editOptions: any = {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
allowTaskbarEditing: true,
mode: "Auto"
}
const taskValues: TaskFieldsModel = {
id: 'TaskID',
name: 'TaskName',
startDate: 'StartDate',
endDate: "EndDate",
duration: 'Duration',
dependency: 'Predeceesor',
child: 'subtasks'
}
return (
<div>
<GanttComponent dataSource={projectData} taskFields={taskValues} editSettings={editOptions}
toolbar={['Add', 'Edit', 'Delete', 'Update', 'Cancel', 'ExpandAll', 'CollapseAll']}
allowSelection={true}>
<Inject services={[Edit, Toolbar, Selection]}></Inject>
<ColumnsDirective>
<ColumnDirective field="TaskID" headerText="ID"></ColumnDirective>
<ColumnDirective field="TaskName" headerText="Name"></ColumnDirective>
<ColumnDirective field="StartDate" format="dd-MMM-yy"></ColumnDirective>
<ColumnDirective field="Duration"></ColumnDirective>
</ColumnsDirective>
</GanttComponent>
</div>
);
}
export default App;