Skip to content

Commit a36e68f

Browse files
fix in LPT API: considerHeaders won't consider cells with checkboxes in listing
1 parent 0bdcb80 commit a36e68f

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LightPivotTable",
33
"author": "ZitRo",
4-
"version": "1.3.2",
4+
"version": "1.3.3",
55
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
66
"main": "test/testServer.js",
77
"repository": {

source/js/PivotView.js

+14-7
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,11 @@ PivotView.prototype.getCellElement = function (x, y, considerHeaders) {
156156
});
157157
table2 = element.getElementsByClassName("lpt-leftHeader")[0]; if (!table) return null;
158158
table2 = table2.getElementsByTagName("table")[0]; if (!table) return null;
159-
hw = 0; [].slice.call((table2.rows[0] || { cells: [] }).cells).forEach(function (e) {
160-
hw += e.colSpan || 1;
161-
});
159+
hw = 0; if (!(this.getCurrentTableData().element || {})["_listing"]) {
160+
[].slice.call((table2.rows[0] || { cells: [] }).cells).forEach(function (e) {
161+
hw += e.colSpan || 1;
162+
});
163+
}
162164
if (x < hw && y < hh)
163165
return element.getElementsByClassName("lpt-headerValue")[0] || null;
164166
if (x >= hw && y < hh)
@@ -200,9 +202,11 @@ PivotView.prototype.getTableSize = function (considerHeaders) {
200202
});
201203
table = element.getElementsByClassName("lpt-leftHeader")[0]; if (!table) return 0;
202204
table = table.getElementsByTagName("table")[0]; if (!table) return 0;
203-
[].slice.call((table.rows[0] || { cells: [] }).cells).forEach(function (e) {
204-
hw += e.colSpan || 1;
205-
});
205+
if (!(this.getCurrentTableData().element || {})["_listing"]) {
206+
[].slice.call((table.rows[0] || { cells: [] }).cells).forEach(function (e) {
207+
hw += e.colSpan || 1;
208+
});
209+
}
206210

207211
return { width: hw, height: hh };
208212

@@ -451,7 +455,9 @@ PivotView.prototype._cellClickHandler = function (cell, x, y, event, drillThroug
451455
f1 = data.rawData[y][data.info.leftHeaderColumnsNumber - 1].source.path;
452456
f2 = data.rawData[data.info.topHeaderRowsNumber - 1 - ATTACH_TOTALS][x].source.path;
453457
} catch (e) {
454-
console.warn("Unable to get filters for cell (%d, %d)", x, y);
458+
if (this.controller.CONFIG["logs"]) {
459+
console.warn("Unable to get filters for cell (%d, %d)", x, y);
460+
}
455461
}
456462

457463
if (f1) f.push(f1);
@@ -1339,6 +1345,7 @@ PivotView.prototype.renderRawData = function (data) {
13391345

13401346
container["_primaryColumns"] = primaryColumns;
13411347
container["_primaryRows"] = primaryRows;
1348+
container["_listing"] = LISTING;
13421349

13431350
this.recalculateSizes(container);
13441351

0 commit comments

Comments
 (0)