forked from syncfusion/ej2-vue-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresizing.vue
83 lines (82 loc) · 3.19 KB
/
resizing.vue
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<template>
<div class="col-lg-12 control-section">
<div id="action-description">
<p>This sample demonstrates the Gantt column resizing feature. Click and drag at the right corner of each column header to resize the column.
</p>
</div>
<div>
<ejs-gantt ref='gantt' id="ColumnResize"
:dataSource= "data"
:height = "height"
:allowResizing= 'true'
:highlightWeekends= 'true'
:taskFields= "taskFields"
:columns= "columns"
:labelSettings= "labelSettings"
:splitterSettings= "splitterSettings"
:treeColumnIndex= "1"
:projectStartDate= "projectStartDate"
:projectEndDate= "projectEndDate"
>
</ejs-gantt>
</div>
<div id="description">
<p>The Gantt columns can be resized by clicking and dragging at the right corner of columns header. Set the <code>allowResizing</code> property to true to enable column resizing behavior in Gantt.
You can also prevent the resize of a particular column
by setting <code>columns -> allowResizing</code> to false in columns definition
</p>
<br/>
<p> In this demo, the allowResizing feature has been enabled by setting the <code>allowResizing</code> property to true.
Task Name column can be resized between a range of <code>minWidth (120 pixels)</code> and <code>maxWidth (300 pixels)</code>.
The column resizing has been disabled in the <b>Duration</b> column
</p>
<p>
More information about Column column Resizing resizing can be found in this documentation section.
</p>
</div>
</div>
</template>
<script>
import Vue from "vue";
import { GanttPlugin, Selection, Resize } from "@syncfusion/ej2-vue-gantt";
import { projectNewData } from './data-source';
Vue.use(GanttPlugin);
export default Vue.extend({
data: function() {
return{
data: projectNewData,
height: '450px',
taskFields: {
id: 'TaskID',
name: 'TaskName',
startDate: 'StartDate',
endDate: 'EndDate',
duration: 'Duration',
progress: 'Progress',
dependency: 'Predecessor',
child: 'subtasks'
},
columns: [
{ field: 'TaskID', headerText: 'ID', width: 70 , minWidth: 8},
{ field: 'TaskName', headerText: 'Job Name', width: 250, minWidth: 120, maxWidth: 300 },
{ field: 'StartDate', width: 135, minWidth: 8 },
{ field: 'EndDate', width: 135, minWidth: 8 },
{ field: 'Duration', allowResizing: false, width: 120 },
{ field: 'Progress', headerText: 'Progress', textAlign: 'Right', width: 120, minWidth: 8 },
{ field: 'Predecessor', headerText: 'Dependency', textAlign: 'Left', width: 135, minWidth: 8 }
],
labelSettings: {
leftLabel: 'TaskName'
},
splitterSettings:{
columnIndex: 6
},
projectStartDate: new Date('03/24/2019'),
projectEndDate: new Date('07/06/2019')
};
},
provide: {
gantt: [Selection, Resize]
}
});
</script>