forked from syncfusion/ej2-vue-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeyboard-interactions.vue
301 lines (300 loc) · 9.87 KB
/
keyboard-interactions.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<template>
<div>
<div class="col-md-9 control-section">
<div class="content-wrapper">
<ejs-gantt ref='gantt' id="KeyboardNavigation"
:dataSource= "data"
:height = "height"
:highlightWeekends= 'true'
:allowKeyboard= 'true'
:taskFields= "taskFields"
:columns= "columns"
:labelSettings= "labelSettings"
:splitterSettings="splitterSettings"
:treeColumnIndex= "1"
:editSettings= "editSettings"
:toolbar= "toolbar"
:projectStartDate= "projectStartDate"
:projectEndDate= "projectEndDate">
</ejs-gantt>
</div>
</div>
<div class="col-md-3 property-section" style="height: 450px;overflow: auto">
<table id="property" title="Properties">
<tr style="height: 50px">
<td style="width: 30%">
<b>Keys</b>
</td>
<td style="width: 70%;padding-right: 10px">
<b>Description</b>
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Home</b>
</td>
<td style="width: 50%">
First Row Selection
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>End</b>
</td>
<td style="width: 50%">
Last Row Selection
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>DownArrow</b>
</td>
<td style="width: 50%">
Move Row Selection Down
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>UpArrow</b>
</td>
<td style="width: 50%">
Move Row Selection Up
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Ctrl + UpArrow</b>
</td>
<td style="width: 50%">
Collapse All
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Ctrl + DownArrow</b>
</td>
<td style="width: 50%">
Expand All
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Ctrl + Shift + UpArrow</b>
</td>
<td style="width: 50%">
Collapse Row
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Ctrl + Shift + DownArrow</b>
</td>
<td style="width: 50%">
Expand Row
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Enter</b>
</td>
<td style="width: 50%">
Save Request
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Esc</b>
</td>
<td style="width: 50%">
Cancel Request
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Insert</b>
</td>
<td style="width: 50%">
Add Record
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Ctrl + Insert</b>
</td>
<td style="width: 50%">
Add Record By Dialog
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Ctrl + F2</b>
</td>
<td style="width: 50%">
Edit Record By Dialog
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Delete</b>
</td>
<td style="width: 50%">
Delete Row
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Ctrl + Shift + F</b>
</td>
<td style="width: 50%">
Focus Search TextBox
</td>
</tr>
<tr style="height:50px;">
<td style="width: 50%">
<b>Shift + F5</b>
</td>
<td style="width: 50%">
Focus Task
</td>
</tr>
</table>
</div>
<div id="action-description">
<p>This demo showcases the keyboard shortcuts applicable on Gantt and also lists out in below descriptions, and this
demo also explains how those applicable shortcuts interacts with Gantt actions.</p>
</div>
<div id="description">
<p>
All the Gantt actions can be controlled via keyboard keys and are availed using the <code>allowKeyboard</code>
property, which is set to true by default. The applicable key combinations and their relative functionalities are listed below.
</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 a toolbar, inject
the <code>Toolbar</code> module using the <code>Gantt.Inject(Toolbar)</code> method.To use a edit, inject the
<code>Edit</code> module using the <code>Gantt.Inject(Edit)</code> method.To use markers, inject the
<code>DayMarkers</code> module using the <code>Gantt.Inject(DayMarkers)</code> method.
</p>
<table>
<tr>
<td><b>Keys</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><code>Home</code></td>
<td>First Row Selection</td>
</tr>
<tr>
<td><code>End</code></td>
<td>Last Row Selection</td>
</tr>
<tr>
<td><code>DownArrow</code></td>
<td>Move Row Selection Down</td>
</tr>
<tr>
<td><code>UpArrow</code></td>
<td>Move Row Selection Up</td>
</tr>
<tr>
<td><code>Ctrl + UpArrow</code></td>
<td>Collapse All</td>
</tr>
<tr>
<td><code>Ctrl + DownArrow</code></td>
<td>Expand All</td>
</tr>
<tr>
<td><code>Ctrl + Shift + UpArrow</code></td>
<td>Collapse Row</td>
</tr>
<tr>
<td><code>Ctrl + Shift + DownArrow</code></td>
<td>Expand Row</td>
</tr>
<tr>
<td><code>Enter</code></td>
<td>Save Request</td>
</tr>
<tr>
<td><code>Esc</code></td>
<td>Cancel Request</td>
</tr>
<tr>
<td><code>Insert</code></td>
<td>Add Record</td>
</tr>
<tr>
<td><code>Ctrl + Insert</code></td>
<td>Add Record By Dialog</td>
</tr>
<tr>
<td><code>Ctrl + F2</code></td>
<td>Edit Record By Dialog</td>
</tr>
<tr>
<td><code>Delete</code></td>
<td>Delete Row</td>
</tr>
<tr>
<td><code>Ctrl + Shift + F</code></td>
<td>Focus Search Textbox</td>
</tr>
<tr>
<td><code>Shift + F5</code></td>
<td>Focus Task</td>
</tr>
</table>
</div>
</div>
</template>
<script>
import Vue from "vue";
import { GanttPlugin, Selection, DayMarkers, Toolbar, Edit, 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', width: 70 },
{ field: 'TaskName', width: 250 },
{ field: 'StartDate' },
{ field: 'EndDate' },
{ field: 'Duration' },
{ field: 'Predecessor' },
{ field: 'Progress' },
],
labelSettings: {
leftLabel: 'TaskName'
},
splitterSettings: {
columnIndex: 2
},
editSettings: {
allowAdding: true,
allowEditing: true,
allowDeleting: true,
},
toolbar: ['Search'],
projectStartDate: new Date('03/24/2019'),
projectEndDate: new Date('07/06/2019'),
};
},
provide: {
gantt: [DayMarkers, Selection, Toolbar, Edit, Filter]
}
});
</script>