Skip to content

Commit 8bd7849

Browse files
committed
fixes grouping example
1 parent 5db188f commit 8bd7849

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

index.html

+38-11
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
font-size: 0.775em;
3232
}
3333
</style>
34-
<!-- <script src="./src/index.js"></script> -->
34+
<script src="dist/frappe-gantt.umd.js"></script>
3535
</head>
3636
<body>
3737
<div class="container">
@@ -338,22 +338,20 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
338338
{
339339
start: daysSince(-2),
340340
end: daysSince(2),
341-
name: 'Write new content',
342-
id: 'Task 1',
343-
progress: 5,
344-
// important: true,
345-
group: 0,
346-
},
347-
{
348341
name: 'Redesign website',
349342
id: 'Task 0',
350343
progress: random(),
351-
group: 0,
352344
},
353345
{
354346
start: daysSince(3),
347+
duration: '6d',
348+
name: 'Write new content',
349+
id: 'Task 1',
355350
progress: random(),
351+
important: true,
356352
dependencies: 'Task 0',
353+
},
354+
{
357355
start: daysSince(4),
358356
duration: '2d',
359357
name: 'Apply new styles',
@@ -376,6 +374,15 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
376374
name: 'Redesign website',
377375
id: 'Task 0',
378376
progress: random(),
377+
group : 0,
378+
},
379+
{
380+
start: daysSince(-5),
381+
end: daysSince(0),
382+
name: 'Redesign website - part 2',
383+
id: 'Task 0',
384+
progress: random(),
385+
group : 0,
379386
},
380387
{
381388
start: daysSince(-15),
@@ -384,20 +391,32 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
384391
id: 'Task 1',
385392
progress: random(),
386393
important: true,
394+
group : 1,
395+
},
396+
{
397+
start: daysSince(7),
398+
duration: '2d',
399+
name: 'Edit new content',
400+
id: 'Task 1',
401+
progress: random(),
402+
important: true,
403+
group : 1,
387404
},
388405
{
389406
start: daysSince(10),
390407
duration: '14d',
391408
name: 'Review',
392409
id: 'Task 3',
393410
progress: random(),
411+
group : 2,
394412
},
395413
{
396414
start: daysSince(-3),
397415
duration: '4d',
398416
name: 'Publish',
399417
id: 'Task 4',
400418
progress: random(),
419+
group : 3,
401420
},
402421
];
403422

@@ -463,6 +482,7 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
463482
duration: '7d',
464483
name: 'Create prototype',
465484
id: 'Task 3',
485+
dependencies: 'Task 2',
466486
progress: random(),
467487
},
468488
{
@@ -474,9 +494,11 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
474494
progress: random(),
475495
important: true,
476496
},
497+
{
477498
start: daysSince(5),
478499
end: daysSince(10),
479500
name: 'Write technical documentation',
501+
id: 'Task 5',
480502
progress: random(),
481503
},
482504
{
@@ -508,6 +530,7 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
508530
id: 'Task 9',
509531
progress: random(),
510532
important: true,
533+
},
511534
];
512535

513536
const HOLIDAYS = [
@@ -534,15 +557,17 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
534557
today_button: true,
535558
view_mode_select: true,
536559
holidays: null,
560+
enable_grouping: true,
561+
groups: [0, 1, 2, 3],
537562
});
538563

539564
const holidays = new Gantt('#holidays', tasksSpread, {
540565
holidays: {
541566
'#bfdbfe': [],
542567
'#a3e635': HOLIDAYS,
543568
},
544-
enable_grouping: true,
545-
groups: [0,1,2,3,4],
569+
enable_grouping: true,
570+
groups: [0, 1, 2, 3],
546571
});
547572

548573
const ignore = new Gantt('#ignore', tasks, {
@@ -562,6 +587,8 @@ <h2>Frappe Gantt - <em>for you</em>.</h2>
562587
snap_at: '1d',
563588
auto_move_label: false,
564589
scroll_to: 'today',
590+
enable_grouping: true,
591+
groups: [0, 1, 2, 3],
565592
});
566593

567594
const UPDATES = [

0 commit comments

Comments
 (0)