Skip to content

Commit 45797b9

Browse files
author
jsGanttImproved
committed
Added new "combined group" task item type functionality
1 parent ea9890e commit 45797b9

File tree

4 files changed

+195
-168
lines changed

4 files changed

+195
-168
lines changed

index.html

Lines changed: 47 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,17 @@
6363
overflow:hidden; }
6464
.nav li { float:left; }
6565
.nav a { display:block; padding-right: 20px;color: #656565;}
66+
a.footnote:link {text-decoration:none;color: red;}
67+
a.footnote:visited {text-decoration:none;color: red;}
68+
a.footnote:hover {text-decoration:underline;color: red;}
69+
a.footnote:active {text-decoration:underline;color: red;}
6670
-->
6771
</style>
6872
</head>
6973
<body>
7074

7175
<div style="position:absolute; z-index: 5; top:0; left:0; width: 100%;">
72-
<div class="header">jsGanttImproved - 1.2</div>
76+
<div class="header">jsGanttImproved - 1.3</div>
7377
<div class="nav">
7478
<ul>
7579
<li><a href="#tBugs">Bugs/Issues</a></li>
@@ -112,15 +116,15 @@
112116
g.AddTaskItem(new JSGantt.TaskItem(3, 'Code Javascript', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1));
113117
g.AddTaskItem(new JSGantt.TaskItem(31, 'Define Variables', '2014-02-25','2014-03-17', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '', 'Caption 1'));
114118
g.AddTaskItem(new JSGantt.TaskItem(32, 'Calculate Chart Size', '2014-03-15','2014-03-24', 'gtaskgreen', '', 0, 'Shlomy', 40, 0, 3, 1));
115-
g.AddTaskItem(new JSGantt.TaskItem(33, 'Draw Taks Items', '', '', 'ggroupblack', '', 0, 'Someone', 40, 1, 3, 1));
116-
g.AddTaskItem(new JSGantt.TaskItem(332, 'Task Label Table', '2014-03-06','2014-03-11', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1));
117-
g.AddTaskItem(new JSGantt.TaskItem(333, 'Task Scrolling Grid', '2014-03-09','2014-03-20', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1));
119+
g.AddTaskItem(new JSGantt.TaskItem(33, 'Draw Task Items', '', '', 'ggroupblack', '', 0, 'Someone', 40, 2, 3, 1));
120+
g.AddTaskItem(new JSGantt.TaskItem(332, 'Task Label Table', '2014-03-06','2014-03-09', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1));
121+
g.AddTaskItem(new JSGantt.TaskItem(333, 'Task Scrolling Grid', '2014-03-11','2014-03-20', 'gtaskblue', '', 0, 'Brian', 0, 0, 33, 1, '332'));
118122
g.AddTaskItem(new JSGantt.TaskItem(34, 'Draw Task Bars', '', '', 'ggroupblack', '', 0, 'Anybody', 60, 1, 3, 0));
119123
g.AddTaskItem(new JSGantt.TaskItem(341, 'Loop each Task', '2014-03-26','2014-04-11', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1));
120124
g.AddTaskItem(new JSGantt.TaskItem(342, 'Calculate Start/Stop', '2014-04-12','2014-05-18', 'gtaskpink', '', 0, 'Brian', 60, 0, 34, 1));
121125
g.AddTaskItem(new JSGantt.TaskItem(343, 'Draw Task Div', '2014-05-13','2014-05-17', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1));
122126
g.AddTaskItem(new JSGantt.TaskItem(344, 'Draw Completion Div', '2014-05-17','2014-06-04', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, "342,343"));
123-
g.AddTaskItem(new JSGantt.TaskItem(35, 'Make Updates', '2014-07-17','2015-09-04', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1));
127+
g.AddTaskItem(new JSGantt.TaskItem(35, 'Make Updates', '2014-07-17','2015-09-04', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '333'));
124128

125129
g.Draw();
126130
} else {
@@ -160,6 +164,19 @@ <h3>Current Issues:</h3>
160164

161165
</ol><br/>
162166
<h3>Changes/fixes in jsGanttImproved:</h3>
167+
<h4>v1.3:</h4>
168+
<ul>
169+
<li>Code refactored to:
170+
<ul>
171+
<li>Move the last non-structural style information from javascript to css file</li>
172+
<li>Tooltip DIV slightly restructured to allow styling rather than relying on line breaks for layout</li>
173+
<li>Create the chart using createElement() and appendChild() rather than innerHTML to enable...</li>
174+
</ul></li>
175+
<li>New "Combined Group" element created. Combined groups show all child task information on one row.</li>
176+
</ul>
177+
<blockquote><p>
178+
Please see the differences for the CSS file in code revision <a href="https://code.google.com/p/jsgantt-improved/source/diff?spec=svn21&old=18&r=21&format=side&path=%2Ftrunk%2Fjsgantt.css">r21</a> for details of CSS structural changes.
179+
</p></blockquote>
163180
<h4>v1.2:</h4>
164181
<ul>
165182
<li>Multiple gantt charts per page are now supported</li>
@@ -169,32 +186,7 @@ <h4>v1.2:</h4>
169186
</p><p>
170187
All chart element ids are now prefixed with the id of the master DIV containing the chart. As a result the default stylesheet has been updated to no longer uses any element ids to apply styles.
171188
</p><p>
172-
The following classes have been renamed:
173-
<pre>
174-
.column -> .gcontainercol
175-
.scroll -> .glistgrid
176-
.scroll2 -> .gchartgrid
177-
.scroll3 -> .glistlbl
178-
.scroll4 -> .gchartlbl
179-
</pre>
180-
</p><p>
181-
Rules using the following ids have been converted to use these classes:
182-
<pre>
183-
#JSGanttToolTip -> .JSGanttToolTip
184-
#JSGanttToolTipcont -> .JSGanttToolTipcont
185-
#chartTable -> .gcharttable
186-
#container -> .gchartcontainer
187-
#footer -> .ggridfooter
188-
#footer2 -> .glabelfooter
189-
#leftside -> .glistgrid (rules combined with old .scroll class)
190-
#leftsideh -> .glistlbl (rules combined with old .scroll3 class)
191-
#rightside -> .gchartgrid (rules combined with old .scroll2 class)
192-
#rightsideh -> .gchartlbl (rules combined with old .scroll4 class)
193-
#taskTable -> .gtasktable
194-
#taskTableh -> .gtasktableh
195-
</pre>
196-
</p><p>
197-
Dependency lines have been altered to use a 1px border rather than background color and the default styles have been updated to reflect this. Two new classes have been defined, .glineh and .glinev for horizontal and vertical lines respectively (1x1 pixel lines are considered to be vertical).
189+
Please see the notes for code revision <a href="http://code.google.com/p/jsgantt-improved/source/detail?r=18">r18</a> for details of CSS structural changes.
198190
</p></blockquote>
199191
<h4>v1.1:</h4>
200192
<ul>
@@ -325,13 +317,15 @@ <h2 class="roundedCornerfg" id="tUsage">Usage</h2>
325317
<dt>pMile</dt><dd>(optional) indicates whether this is a milestone task - Numeric; 1 = milestone, 0 = not milestone</dd>
326318
<dt>pRes</dt><dd>(optional) resource name</dd>
327319
<dt>pComp</dt><dd>(required) completion percent, numeric</dd>
328-
<dt>pGroup</dt><dd>(optional) indicates whether this is a group task(parent) - Numeric; 1 = group task, 0 = not group task</dd>
320+
<dt>pGroup</dt><dd>(optional) indicates whether this is a group task (parent) - Numeric; 0 = normal task, 1 = standard group task, 2 = combined group task<a href='#combinedtasks' class="footnote">*</a></dd>
329321
<dt>pParent</dt><dd>(required) identifies a parent pID, this causes this task to be a child of identified task. Numeric, top level tasks should have pParent set to 0</dd>
330-
<dt>pOpen</dt><dd>(required) indicates whether a group task is open when chart is first drawn. Value must be set for all items but is only used by group tasks. Numeric, 1 = open, 0 = closed</dd>
322+
<dt>pOpen</dt><dd>(required) indicates whether a standard group task is open when chart is first drawn. Value must be set for all items but is only used by standard group tasks. Numeric, 1 = open, 0 = closed</dd>
331323
<dt>pDepend</dt><dd>(optional) comma separated list of id&#39;s this task is dependent on. A line will be drawn from each listed task to this item<br />Each id can optionally be followed by a dependency type suffix. Valid values are:<blockquote>'FS' - Finish to Start (default if suffix is omitted)<br />'SF' - Start to Finish<br />'SS' - Start to Start<br />'FF' - Finish to Finish</blockquote>If present the suffix must be added directly to the id e.g. '123SS'</dd>
332324
<dt>pCaption</dt><dd>(optional) caption that will be added after task bar if CaptionType set to "Caption"</dd>
333325
<dt>pNotes</dt><dd>(optional) Detailed task information that will be displayed in tool tip for this task</dd>
334326
</dl>
327+
<p id='combinedtasks'><span style="color: red;">*</span> Combined group tasks show all sub-tasks on one row. The information displayed in the task list and row caption are taken from the parent task. Tool tips are generated individually for each sub-task from its own information. Milestones are not valid as sub-tasks of a combined group task and will not be displayed. No bounds checking of start and end dates of sub-tasks is performed therefore it is possible for these task bars to overlap. Dependencies can be set to and from sub-tasks only.
328+
</p>
335329
</li>
336330
<li>using parseXML() with an external XML file
337331
<pre class="style1">
@@ -501,26 +495,26 @@ <h3 id="tOptionsExamples">Example Options</h3>
501495
g.setShowEndWeekDate(0);
502496
g.setUseSingleCell(1);
503497

504-
g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1, '', '', 'Some Notes text' ));
505-
g.AddTaskItem(new JSGantt.TaskItem(11, 'Chart Object', '2014-02-20','2014-02-20', 'gmilestone', '', 1, 'Shlomy', 100, 0, 1, 1));
506-
g.AddTaskItem(new JSGantt.TaskItem(12, 'Task Objects', '', '', 'ggroupblack', '', 0, 'Shlomy', 40, 1, 1, 1));
507-
g.AddTaskItem(new JSGantt.TaskItem(121, 'Constructor Proc', '2014-02-21','2014-03-09', 'gtaskblue', '', 0, 'Brian T.', 60, 0, 12, 1));
508-
g.AddTaskItem(new JSGantt.TaskItem(122, 'Task Variables', '2014-03-06','2014-03-11', 'gtaskred', '', 0, 'Brian', 60, 0, 12, 1, 121));
509-
g.AddTaskItem(new JSGantt.TaskItem(123, 'Task by Minute/Hour', '2014-03-09','2014-03-14 12:00', 'gtaskyellow', '', 0, 'Ilan', 60, 0, 12, 1, ''));
510-
g.AddTaskItem(new JSGantt.TaskItem(124, 'Task Functions', '2014-03-09','2014-03-29', 'gtaskred', '', 0, 'Anyone', 60, 0, 12, 1, '123SS', 'This is a caption', null));
511-
g.AddTaskItem(new JSGantt.TaskItem(2, 'Create HTML Shell', '2014-03-24','2014-03-24', 'gtaskyellow', '', 0, 'Brian', 20, 0, 0, 1, 122));
512-
g.AddTaskItem(new JSGantt.TaskItem(3, 'Code Javascript', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1));
513-
g.AddTaskItem(new JSGantt.TaskItem(31, 'Define Variables', '2014-02-25','2014-03-17', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '', 'Caption 1'));
514-
g.AddTaskItem(new JSGantt.TaskItem(32, 'Calculate Chart Size', '2014-03-15','2014-03-24', 'gtaskgreen', '', 0, 'Shlomy', 40, 0, 3, 1));
515-
g.AddTaskItem(new JSGantt.TaskItem(33, 'Draw Taks Items', '', '', 'ggroupblack', '', 0, 'Someone', 40, 1, 3, 1));
516-
g.AddTaskItem(new JSGantt.TaskItem(332, 'Task Label Table', '2014-03-06','2014-03-11', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1));
517-
g.AddTaskItem(new JSGantt.TaskItem(333, 'Task Scrolling Grid', '2014-03-09','2014-03-20', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1));
518-
g.AddTaskItem(new JSGantt.TaskItem(34, 'Draw Task Bars', '', '', 'ggroupblack', '', 0, 'Anybody', 60, 1, 3, 0));
519-
g.AddTaskItem(new JSGantt.TaskItem(341, 'Loop each Task', '2014-03-26','2014-04-11', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1));
520-
g.AddTaskItem(new JSGantt.TaskItem(342, 'Calculate Start/Stop', '2014-04-12','2014-05-18', 'gtaskpink', '', 0, 'Brian', 60, 0, 34, 1));
521-
g.AddTaskItem(new JSGantt.TaskItem(343, 'Draw Task Div', '2014-05-13','2014-05-17', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1));
522-
g.AddTaskItem(new JSGantt.TaskItem(344, 'Draw Completion Div', '2014-05-17','2014-06-04', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, "342,343"));
523-
g.AddTaskItem(new JSGantt.TaskItem(35, 'Make Updates', '2014-07-17','2015-09-04', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1));
498+
g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1, '', '', 'Some Notes text' ));
499+
g.AddTaskItem(new JSGantt.TaskItem(11, 'Chart Object', '2014-02-20','2014-02-20', 'gmilestone', '', 1, 'Shlomy', 100, 0, 1, 1));
500+
g.AddTaskItem(new JSGantt.TaskItem(12, 'Task Objects', '', '', 'ggroupblack', '', 0, 'Shlomy', 40, 1, 1, 1));
501+
g.AddTaskItem(new JSGantt.TaskItem(121, 'Constructor Proc', '2014-02-21','2014-03-09', 'gtaskblue', '', 0, 'Brian T.', 60, 0, 12, 1));
502+
g.AddTaskItem(new JSGantt.TaskItem(122, 'Task Variables', '2014-03-06','2014-03-11', 'gtaskred', '', 0, 'Brian', 60, 0, 12, 1, 121));
503+
g.AddTaskItem(new JSGantt.TaskItem(123, 'Task by Minute/Hour', '2014-03-09','2014-03-14 12:00', 'gtaskyellow', '', 0, 'Ilan', 60, 0, 12, 1, ''));
504+
g.AddTaskItem(new JSGantt.TaskItem(124, 'Task Functions', '2014-03-09','2014-03-29', 'gtaskred', '', 0, 'Anyone', 60, 0, 12, 1, '123SS', 'This is a caption', null));
505+
g.AddTaskItem(new JSGantt.TaskItem(2, 'Create HTML Shell', '2014-03-24','2014-03-24', 'gtaskyellow', '', 0, 'Brian', 20, 0, 0, 1, 122));
506+
g.AddTaskItem(new JSGantt.TaskItem(3, 'Code Javascript', '', '', 'ggroupblack', '', 0, 'Brian', 0, 1, 0, 1));
507+
g.AddTaskItem(new JSGantt.TaskItem(31, 'Define Variables', '2014-02-25','2014-03-17', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '', 'Caption 1'));
508+
g.AddTaskItem(new JSGantt.TaskItem(32, 'Calculate Chart Size', '2014-03-15','2014-03-24', 'gtaskgreen', '', 0, 'Shlomy', 40, 0, 3, 1));
509+
g.AddTaskItem(new JSGantt.TaskItem(33, 'Draw Task Items', '', '', 'ggroupblack', '', 0, 'Someone', 40, 2, 3, 1));
510+
g.AddTaskItem(new JSGantt.TaskItem(332, 'Task Label Table', '2014-03-06','2014-03-09', 'gtaskblue', '', 0, 'Brian', 60, 0, 33, 1));
511+
g.AddTaskItem(new JSGantt.TaskItem(333, 'Task Scrolling Grid', '2014-03-11','2014-03-20', 'gtaskblue', '', 0, 'Brian', 0, 0, 33, 1, '332'));
512+
g.AddTaskItem(new JSGantt.TaskItem(34, 'Draw Task Bars', '', '', 'ggroupblack', '', 0, 'Anybody', 60, 1, 3, 0));
513+
g.AddTaskItem(new JSGantt.TaskItem(341, 'Loop each Task', '2014-03-26','2014-04-11', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1));
514+
g.AddTaskItem(new JSGantt.TaskItem(342, 'Calculate Start/Stop', '2014-04-12','2014-05-18', 'gtaskpink', '', 0, 'Brian', 60, 0, 34, 1));
515+
g.AddTaskItem(new JSGantt.TaskItem(343, 'Draw Task Div', '2014-05-13','2014-05-17', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1));
516+
g.AddTaskItem(new JSGantt.TaskItem(344, 'Draw Completion Div', '2014-05-17','2014-06-04', 'gtaskred', '', 0, 'Brian', 60, 0, 34, 1, "342,343"));
517+
g.AddTaskItem(new JSGantt.TaskItem(35, 'Make Updates', '2014-07-17','2015-09-04', 'gtaskpurple', '', 0, 'Brian', 30, 0, 3, 1, '333'));
524518

525519
g.Draw();
526520
}

jsgantt.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Sample CSS for jsGanttImproved v1.2.2 */
1+
/* Sample CSS for jsGanttImproved v1.3 */
22
body { font-family:tahoma, arial, verdana, Sans-serif; font-size:10px; color: #656565; }
33

44
.gantt table { border-collapse: collapse; }

0 commit comments

Comments
 (0)