Skip to content

Commit a06a02a

Browse files
Link target attribute option support, drilldown path return, getActualMDX fix
1 parent afccc95 commit a06a02a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LightPivotTable",
33
"author": "ZitRo",
4-
"version": "1.6.5",
4+
"version": "1.6.8",
55
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
66
"main": "test/testServer.js",
77
"repository": {
@@ -22,7 +22,8 @@
2222
"gulp-zip": "^2.0.2"
2323
},
2424
"scripts": {
25-
"test": "node test/testServer.js"
25+
"test": "node test/testServer.js",
26+
"build": "gulp"
2627
},
2728
"keywords": [
2829
"pivot",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ var setup = { // Object that contain settings. Properties in brackets can be mis
8181
[ , showListingRowsNumber: true ] // show rows number in listing and tables if paginated
8282
[ , rowCount: 5 ] // number of rows to show. Use lp.setRowCount(N) to change rowCount. Manual lp.refresh() needed to apply.
8383
[ , initialData: { ... } ] // initial data from /MDX query (if present, in MDX2JSON format). Pivot won't request /MDX first time if initial data set. Check twice that dataSource.basicMDX is consistent with the data in this option.
84+
[ , linksTarget: "_blank" ] // the value of target attributes on all the links on light pivot
8485
},
8586
lp = new LightPivotTable(setup);
8687

source/js/LightPivotTable.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ LightPivotTable.prototype.setRowCount = function (n) {
104104
*/
105105
LightPivotTable.prototype.getActualMDX = function () {
106106

107-
var mdx = this.CONFIG.dataSource.basicMDX,
107+
var mdx = this.dataSource.BASIC_MDX,
108108
mdxParser = new MDXParser(),
109109
filters = this.dataSource.FILTERS;
110110

@@ -262,7 +262,8 @@ LightPivotTable.prototype.tryDrillDown = function (filter) {
262262
if (typeof _.CONFIG.triggers["drillDown"] === "function") {
263263
_.CONFIG.triggers["drillDown"].call(_, {
264264
level: _.DRILL_LEVEL,
265-
mdx: ds.basicMDX
265+
mdx: ds.basicMDX,
266+
path: data.dimensions[1][0]["path"] || ""
266267
});
267268
}
268269
} else {

source/js/PivotView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,8 @@ PivotView.prototype.renderRawData = function (data) {
11001100
element.className += " formatLeft";
11011101
element.innerHTML = (value || "").replace(/(https?|ftp):\/\/[^\s]+/ig, function linkReplace (p) {
11021102
return "<a href='" + p
1103-
+ "' target='_blank' onclick='var e=event||window.event;e.stopPropagation();e.cancelBubble=true;'>"
1103+
+ "' target='" + (_.controller.CONFIG["linksTarget"] || "_blank")
1104+
+ "' onclick='var e=event||window.event;e.stopPropagation();e.cancelBubble=true;'>"
11041105
+ p + "</a>";
11051106
});
11061107
} else if (!LISTING) { // number

0 commit comments

Comments
 (0)