Skip to content

Commit 9cc17e6

Browse files
committed
#316 v2.7.2
1 parent 5cc3294 commit 9cc17e6

File tree

6 files changed

+217
-164
lines changed

6 files changed

+217
-164
lines changed

dist/jsgantt.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ div.gantt {
4444
border-right: none;
4545
}
4646

47+
.gtasknolist-label{
48+
padding: 10px 50px;
49+
}
4750
/* all three width values set just to make sure - helps resizing code */
4851

4952
/* Additional values for some cell elements */

dist/jsgantt.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@ exports.GanttChart = function (pDiv, pFormat) {
270270
for (var i = 0; i < this.vTaskList.length; i++) {
271271
_loop_1(i);
272272
}
273+
// Render no daa in the chart
274+
if (this.vTaskList.length == 0) {
275+
var totalColumns = this.getColumnOrder()
276+
.filter(function (column) { return _this[column] == 1 || column === 'vAdditionalHeaders'; })
277+
.length;
278+
var vTmpRow_2 = draw_utils_1.newNode(vTmpContentTBody, 'tr', this.vDivId + 'child_', 'gname ');
279+
// this.vTaskList[i].setListChildRow(vTmpRow);
280+
var vTmpCell_2 = draw_utils_1.newNode(vTmpRow_2, 'td', null, 'gtasknolist', '', null, null, null, totalColumns);
281+
var vOutput = document.createDocumentFragment();
282+
draw_utils_1.newNode(vOutput, 'div', null, 'gtasknolist-label', this.vLangs[this.vLang]['nodata'] + '.');
283+
vTmpCell_2.appendChild(vOutput);
284+
}
273285
// DRAW the date format selector at bottom left.
274286
var vTmpRow = draw_utils_1.newNode(vTmpContentTBody, 'tr');
275287
draw_utils_1.newNode(vTmpRow, 'td', null, 'gtasklist', '\u00A0');
@@ -690,10 +702,6 @@ exports.GanttChart = function (pDiv, pFormat) {
690702
bd = new Date();
691703
console.info('before draw', bd);
692704
}
693-
if (this.vTaskList.length === 0) {
694-
this.drawComplete(vMinDate, vColWidth, bd);
695-
return;
696-
}
697705
// Process all tasks, reset parent date and completion % if task list has altered
698706
if (this.vProcessNeeded)
699707
task_1.processRows(this.vTaskList, 0, -1, 1, 1, this.getUseSort(), this.vDebug);
@@ -1805,6 +1813,7 @@ var es = {
18051813
'enddate': 'Fin',
18061814
'planenddate': 'Fin Planificado',
18071815
'moreinfo': 'Más Información',
1816+
'nodata': 'No tasks found',
18081817
'notes': 'Notas',
18091818
'format': 'Formato',
18101819
'hour': 'Hora',
@@ -1862,6 +1871,7 @@ var en = {
18621871
'planenddate': 'Plan End Date',
18631872
'cost': 'Cost',
18641873
'moreinfo': 'More Information',
1874+
'nodata': 'No tasks found',
18651875
'notes': 'Notes',
18661876
'january': 'January',
18671877
'february': 'February',
@@ -1936,6 +1946,7 @@ var de = {
19361946
'planenddate': 'Plan Letzte Buchung',
19371947
'cost': 'Cost',
19381948
'moreinfo': 'Weitere Infos',
1949+
'nodata': 'No tasks found',
19391950
'notes': 'Anmerkung',
19401951
'january': 'Jänner',
19411952
'february': 'Februar',
@@ -1997,6 +2008,7 @@ var pt = {
19972008
'completion': 'Terminado',
19982009
'comp': '% Completado',
19992010
'moreinfo': 'Mais informações',
2011+
'nodata': 'Sem atividades',
20002012
'notes': 'Notas',
20012013
'res': 'Responsável',
20022014
'dur': 'Duração',
@@ -2086,6 +2098,7 @@ var ru = {
20862098
'planenddate': 'Plan Кон. дата',
20872099
'cost': 'Cost',
20882100
'moreinfo': 'Детали',
2101+
'nodata': 'No tasks found',
20892102
'notes': 'Заметки',
20902103
'format': 'Формат',
20912104
'hour': 'Час',
@@ -2111,9 +2124,11 @@ var ru = {
21112124
'tooltipLoading': 'Загрузка...'
21122125
};
21132126
exports.ru = ru;
2127+
/**
2128+
* Mois : http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?id=3619
2129+
Jours : http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?id=3617
2130+
*/
21142131
var fr = {
2115-
// Mois : http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?id=3619
2116-
// Jours : http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?id=3617
21172132
'january': 'Janvier',
21182133
'february': 'Février',
21192134
'march': 'Mars',
@@ -2162,6 +2177,7 @@ var fr = {
21622177
'planenddate': 'Plan Fin',
21632178
'cost': 'Cost',
21642179
'moreinfo': "Plus d'informations",
2180+
'nodata': 'No tasks found',
21652181
'notes': 'Notes',
21662182
'format': 'Format',
21672183
'hour': 'Heure',
@@ -2235,6 +2251,7 @@ var cn = {
22352251
'planenddate': '計劃截止日期',
22362252
'cost': '成本',
22372253
'moreinfo': "更多資訊",
2254+
'nodata': 'No tasks found',
22382255
'notes': '備註',
22392256
'format': '格式',
22402257
'hour': '時',
@@ -2291,6 +2308,7 @@ var sv = {
22912308
'planenddate': 'Planerad slutdatum',
22922309
'cost': 'Kostnad',
22932310
'moreinfo': 'Mer Information',
2311+
'nodata': 'No tasks found',
22942312
'notes': 'Notes',
22952313
'january': 'januari',
22962314
'february': 'februari',
@@ -2364,6 +2382,7 @@ var nl = {
23642382
'planenddate': 'Geplande einddatum',
23652383
'cost': 'Kosten',
23662384
'moreinfo': 'Meer informatie',
2385+
'nodata': 'No tasks found',
23672386
'notes': 'Notities',
23682387
'january': 'januari',
23692388
'february': 'februari',
@@ -2437,6 +2456,7 @@ var id = {
24372456
'planenddate': 'Perencanaan Tanggal Akhir',
24382457
'cost': 'Biaya',
24392458
'moreinfo': 'Informasi Lebih Lanjut',
2459+
'nodata': 'No tasks found',
24402460
'notes': 'Catatan',
24412461
'january': 'Januari',
24422462
'february': 'Februari',
@@ -2510,6 +2530,7 @@ var tr = {
25102530
'planenddate': 'Plan Bitiş Tarihi',
25112531
'cost': 'Tutar',
25122532
'moreinfo': 'Daha Fazla Bilgi',
2533+
'nodata': 'No tasks found',
25132534
'notes': 'Notlar',
25142535
'january': 'Ocak',
25152536
'february': 'Şubat',
@@ -2583,6 +2604,7 @@ var ja = {
25832604
'planenddate': '予定期日',
25842605
'cost': 'コスト',
25852606
'moreinfo': '詳細',
2607+
'nodata': 'No tasks found',
25862608
'notes': 'ノート',
25872609
'january': '1月',
25882610
'february': '2月',
@@ -2657,6 +2679,7 @@ var cs = {
26572679
'planenddate': 'Plánovaný konec',
26582680
'cost': 'Náklady',
26592681
'moreinfo': 'Více informací',
2682+
'nodata': 'No tasks found',
26602683
'notes': 'Poznámky',
26612684
'january': 'Leden',
26622685
'february': 'Únor',
@@ -2731,6 +2754,7 @@ var hu = {
27312754
'planenddate': 'Tervezett befejezés',
27322755
'cost': 'Költség',
27332756
'moreinfo': 'További információ',
2757+
'nodata': 'No tasks found',
27342758
'notes': 'Jegyzetek',
27352759
'january': 'Január',
27362760
'february': 'Február',
@@ -2805,6 +2829,7 @@ var ko = {
28052829
'planenddate': '계획 종료일자',
28062830
'cost': '비용',
28072831
'moreinfo': '더 많은 정보',
2832+
'nodata': 'No tasks found',
28082833
'notes': '비고',
28092834
'january': '1월',
28102835
'february': '2월',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsgantt-improved",
3-
"version": "2.7.1",
3+
"version": "2.7.2",
44
"description": "jsgantt-improved",
55
"main": "dist/index.js",
66
"scripts": {

src/draw.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,19 @@ export const GanttChart = function (pDiv, pFormat) {
292292
}
293293
}
294294

295+
// Render no daa in the chart
296+
if (this.vTaskList.length == 0) {
297+
298+
let totalColumns = this.getColumnOrder()
299+
.filter(column => this[column] == 1 || column === 'vAdditionalHeaders')
300+
.length
301+
let vTmpRow = newNode(vTmpContentTBody, 'tr', this.vDivId + 'child_', 'gname ');
302+
// this.vTaskList[i].setListChildRow(vTmpRow);
303+
let vTmpCell = newNode(vTmpRow, 'td', null, 'gtasknolist', '', null, null, null, totalColumns);
304+
let vOutput = document.createDocumentFragment();
305+
newNode(vOutput, 'div', null, 'gtasknolist-label', this.vLangs[this.vLang]['nodata'] + '.');
306+
vTmpCell.appendChild(vOutput);
307+
}
295308
// DRAW the date format selector at bottom left.
296309
let vTmpRow = newNode(vTmpContentTBody, 'tr');
297310
newNode(vTmpRow, 'td', null, 'gtasklist', '\u00A0');
@@ -760,11 +773,6 @@ export const GanttChart = function (pDiv, pFormat) {
760773
console.info('before draw', bd);
761774
}
762775

763-
if (this.vTaskList.length === 0) {
764-
this.drawComplete(vMinDate, vColWidth, bd);
765-
return;
766-
}
767-
768776
// Process all tasks, reset parent date and completion % if task list has altered
769777
if (this.vProcessNeeded) processRows(this.vTaskList, 0, -1, 1, 1, this.getUseSort(), this.vDebug);
770778
this.vProcessNeeded = false;

src/jsgantt.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ div.gantt {
4444
border-right: none;
4545
}
4646

47+
.gtasknolist-label{
48+
padding: 10px 50px;
49+
}
4750
/* all three width values set just to make sure - helps resizing code */
4851

4952
/* Additional values for some cell elements */

0 commit comments

Comments
 (0)