forked from syncfusion/ej2-vue-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrid-lines.vue
116 lines (114 loc) · 4.18 KB
/
grid-lines.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<template>
<div>
<div class="col-md-9 control-section">
<div class="content-wrapper">
<ejs-gantt ref='gantt' id="GridLines"
:dataSource= "data"
:height = "height"
:highlightWeekends= 'true'
:taskFields= "taskFields"
:columns= "columns"
:labelSettings= "labelSettings"
:splitterSettings="splitterSettings"
:treeColumnIndex= "1"
:gridLines = "gridLines"
:projectStartDate= "projectStartDate"
:projectEndDate= "projectEndDate">
</ejs-gantt>
</div>
</div>
<div class="col-md-3 property-section">
<table id="property" title="Properties">
<tr>
<td style="width: 50%; fontSize: 15px">
Grid Lines
</td>
</tr>
<tr>
<td style="width: 50%;padding: 10px 10px 10px 0px">
<ejs-dropdownlist id='gridlines' width='100px' :dataSource='linesData' value='Both' :fields='linesFields' :change="lineChange"></ejs-dropdownlist>
</td>
</tr>
</table>
</div>
<div id="action-description">
<p>This sample demonstrates the visibility of Gantt lines that separate the rows and columns.
In this sample, you can change the gridlines from the property panel.</p>
</div>
<div id="description">
<p>
The <code>gridLines</code> property is used to control the visibility of line that separates the rows and
columns.
Gantt allows us to display the following grid lines:
</p>
<ul>
<li><code>None</code> - Shows no line.</li>
<li><code>Both</code> - Shows both horizontal and vertical lines.</li>
<li><code>Horizontal</code> - Shows the horizontal line.</li>
<li><code>Vertical</code> - Shows the vertical line.</li>
</ul>
<p> In this demo, you can modify the visibility of gridlines by selecting values in dropdown.</p>
<p>Gantt component features are segregated into individual feature-wise modules.To use a selection, inject the
<code>Selection</code> module using the <code>Gantt.Inject(Selection)</code> method.To use markers, inject the <code>DayMarkers</code> module using the <code>Gantt.Inject(DayMarkers)</code> method.</p>
</div>
</div>
</template>
<script>
import Vue from "vue";
import { GanttPlugin, Selection, DayMarkers } from "@syncfusion/ej2-vue-gantt";
import { projectNewData } from './data-source';
import { DropDownListPlugin, ChangeEventArgs} from '@syncfusion/ej2-vue-dropdowns';
Vue.use(GanttPlugin);
Vue.use(DropDownListPlugin);
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', width: 70 },
{ field: 'TaskName', width: 250 },
{ field: 'StartDate' },
{ field: 'EndDate' },
{ field: 'Duration' },
{ field: 'Predecessor' },
{ field: 'Progress' },
],
labelSettings: {
leftLabel: 'TaskName'
},
splitterSettings: {
columnIndex: 2
},
gridLines: "Both",
projectStartDate: new Date('03/24/2019'),
projectEndDate: new Date('07/06/2019'),
linesFields: { text: 'type', value: 'id' },
linesData: [
{ id: 'Both', type: 'Both' },
{ id: 'Vertical', type: 'Vertical' },
{ id: 'Horizontal', type: 'Horizontal' },
{ id: 'None', type: 'None' }
]
};
},
provide: {
gantt: [DayMarkers, Selection]
},
methods: {
lineChange: function(e) {
this.gridLines = e.value;
}
}
});
</script>