forked from syncfusion/ej2-vue-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolumn-menu.vue
96 lines (93 loc) · 3.42 KB
/
column-menu.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
<template>
<div class="col-lg-12 control-section">
<div id="action-description">
<p>This sample demonstrates the default functionalities of the column menu. Click on multiple icon of each column to open the column menu.</p>
</div>
<div>
<ejs-gantt ref='gantt' id="ColumnMenu"
:dataSource= "data"
:height = "height"
:showColumnMenu= 'true'
:allowFiltering= 'true'
:allowSorting= 'true'
: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>
Gantt has an option to show column menu while clicking multiple icon of each column. The column menu has an integrated option to interact with the features such as sorting, filtering, column chooser, and autoFit.
This feature can be enabled by setting <code>showColumnMenu</code> to true.
The default items are,
<br>
</p>
<ul>
<li><code>SortAscending</code> - Sorts the current column in ascending order.</li>
<li><code>SortDescending</code> - Sorts the current column in descending order.</li>
<li><code>AutoFit</code> - Auto-fit current column.</li>
<li><code>AutoFitAll</code> - Auto-fit all columns.</li>
<li><code>ColumnChooser</code> - Chooses the column visibility.</li>
<li><code>Filter</code> - Filters the current column.</li>
</ul>
<br/>
<p>
In this demo, the column menu feature is enabled by setting <code>showColumnMenu</code> to true with sorting, filtering, column chooser, and autoFit options.
</p>
<p>
More information about column menu can be found in this documentation section.
</p>
</div>
</div>
</template>
<script>
import Vue from "vue";
import { GanttPlugin, Selection, Sort, Resize, ColumnMenu, Filter} 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: 110 },
{ field: 'TaskName', headerText: 'Name', width: 250 },
{ field: 'StartDate' },
{ field: 'EndDate' },
{ field: 'Duration' },
{ field: 'Progress' },
{ field: 'Predecessor', headerText: 'Dependency' }
],
labelSettings: {
leftLabel: 'TaskName'
},
splitterSettings:{
columnIndex: 4
},
projectStartDate: new Date('03/24/2019'),
projectEndDate: new Date('07/06/2019'),
};
},
provide: {
gantt: [Selection, Sort, Resize, ColumnMenu, Filter]
}
});
</script>