Skip to content

Commit 5cc3294

Browse files
committed
#329 v2.7.1
1 parent 18b4861 commit 5cc3294

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

Documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ g.setOptions({
505505
planstart: console.log,
506506
planend: console.log,
507507
cost: console.log,
508+
additional_category: console.log, // for additional fields
508509
beforeDraw: ()=>console.log('before draw listener'),
509510
afterDraw: ()=>console.log('before after listener')
510511
},

dist/jsgantt.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,10 @@ exports.draw_header = function (column, i, vTmpRow, vTaskList, vEditable, vEvent
939939
var css = header.class ? header.class : "gadditional-" + key;
940940
var data = vTaskList[i].getDataObject();
941941
vTmpCell = draw_utils_1.newNode(vTmpRow, 'td', null, "gadditional " + css);
942+
vTmpDiv = draw_utils_1.newNode(vTmpCell, 'div', null, null, data ? data[key] : '');
943+
events_1.addListenerClickCell(vTmpCell, vEvents, vTaskList[i], "additional_" + key);
942944
// const callback = (task, e) => task.setCost(e.target.value);
943945
// addListenerInputCell(vTmpCell, vEventsChange, callback, vTaskList, i, 'costdate');
944-
vTmpDiv = draw_utils_1.newNode(vTmpCell, 'div', null, null, data ? data[key] : '');
945946
}
946947
}
947948
if ('vShowAddEntries' === column) {
@@ -1387,7 +1388,7 @@ exports.addListenerClickCell = function (vTmpCell, vEvents, task, column) {
13871388
exports.addListener('click', function (e) {
13881389
if (e.target.classList.contains('gfoldercollapse') === false &&
13891390
vEvents[column] && typeof vEvents[column] === 'function') {
1390-
vEvents[column](task, e, vTmpCell);
1391+
vEvents[column](task, e, vTmpCell, column);
13911392
}
13921393
}, vTmpCell);
13931394
};

docs/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function start(e) {
8686
planstart: console.log,
8787
planend: console.log,
8888
cost: console.log,
89+
additional_category: console.log,
8990
beforeDraw: () => console.log('before draw listener'),
9091
afterDraw: () => {
9192
console.log('after draw listener');

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.0",
3+
"version": "2.7.1",
44
"description": "jsgantt-improved",
55
"main": "dist/index.js",
66
"scripts": {

src/draw_columns.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ export const draw_header = function (column, i, vTmpRow, vTaskList, vEditable, v
108108
const css = header.class ? header.class : `gadditional-${key}`;
109109
const data = vTaskList[i].getDataObject();
110110
vTmpCell = newNode(vTmpRow, 'td', null, `gadditional ${css}`);
111+
vTmpDiv = newNode(vTmpCell, 'div', null, null, data ? data[key] : '');
112+
addListenerClickCell(vTmpCell, vEvents, vTaskList[i], `additional_${key}`);
111113
// const callback = (task, e) => task.setCost(e.target.value);
112114
// addListenerInputCell(vTmpCell, vEventsChange, callback, vTaskList, i, 'costdate');
113-
vTmpDiv = newNode(vTmpCell, 'div', null, null, data ? data[key] : '');
114115
}
115116
}
116117

src/events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export const addListenerClickCell = function (vTmpCell, vEvents, task, column) {
307307
addListener('click', function (e) {
308308
if (e.target.classList.contains('gfoldercollapse') === false &&
309309
vEvents[column] && typeof vEvents[column] === 'function') {
310-
vEvents[column](task, e, vTmpCell);
310+
vEvents[column](task, e, vTmpCell, column);
311311
}
312312
}, vTmpCell);
313313
}

0 commit comments

Comments
 (0)