diff --git a/package.json b/package.json index 33c4d61..f620320 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "LightPivotTable", "author": "ZitRo", - "version": "1.6.5", + "version": "1.6.8", "description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache", "main": "test/testServer.js", "repository": { @@ -22,7 +22,8 @@ "gulp-zip": "^2.0.2" }, "scripts": { - "test": "node test/testServer.js" + "test": "node test/testServer.js", + "build": "gulp" }, "keywords": [ "pivot", diff --git a/readme.md b/readme.md index d154f95..fc10be0 100644 --- a/readme.md +++ b/readme.md @@ -81,6 +81,7 @@ var setup = { // Object that contain settings. Properties in brackets can be mis [ , showListingRowsNumber: true ] // show rows number in listing and tables if paginated [ , rowCount: 5 ] // number of rows to show. Use lp.setRowCount(N) to change rowCount. Manual lp.refresh() needed to apply. [ , 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. + [ , linksTarget: "_blank" ] // the value of target attributes on all the links on light pivot }, lp = new LightPivotTable(setup); diff --git a/source/js/LightPivotTable.js b/source/js/LightPivotTable.js index 47e106d..42a709d 100644 --- a/source/js/LightPivotTable.js +++ b/source/js/LightPivotTable.js @@ -104,7 +104,7 @@ LightPivotTable.prototype.setRowCount = function (n) { */ LightPivotTable.prototype.getActualMDX = function () { - var mdx = this.CONFIG.dataSource.basicMDX, + var mdx = this.dataSource.BASIC_MDX, mdxParser = new MDXParser(), filters = this.dataSource.FILTERS; @@ -262,7 +262,8 @@ LightPivotTable.prototype.tryDrillDown = function (filter) { if (typeof _.CONFIG.triggers["drillDown"] === "function") { _.CONFIG.triggers["drillDown"].call(_, { level: _.DRILL_LEVEL, - mdx: ds.basicMDX + mdx: ds.basicMDX, + path: data.dimensions[1][0]["path"] || "" }); } } else { diff --git a/source/js/PivotView.js b/source/js/PivotView.js index b65d072..104ee0e 100644 --- a/source/js/PivotView.js +++ b/source/js/PivotView.js @@ -1100,7 +1100,8 @@ PivotView.prototype.renderRawData = function (data) { element.className += " formatLeft"; element.innerHTML = (value || "").replace(/(https?|ftp):\/\/[^\s]+/ig, function linkReplace (p) { return "" + + "' target='" + (_.controller.CONFIG["linksTarget"] || "_blank") + + "' onclick='var e=event||window.event;e.stopPropagation();e.cancelBubble=true;'>" + p + ""; }); } else if (!LISTING) { // number