Skip to content

Commit

Permalink
Link target attribute option support, drilldown path return, getActua…
Browse files Browse the repository at this point in the history
…lMDX fix
  • Loading branch information
nikitaeverywhere committed Jun 9, 2016
1 parent afccc95 commit a06a02a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -22,7 +22,8 @@
"gulp-zip": "^2.0.2"
},
"scripts": {
"test": "node test/testServer.js"
"test": "node test/testServer.js",
"build": "gulp"
},
"keywords": [
"pivot",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions source/js/LightPivotTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion source/js/PivotView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,8 @@ PivotView.prototype.renderRawData = function (data) {
element.className += " formatLeft";
element.innerHTML = (value || "").replace(/(https?|ftp):\/\/[^\s]+/ig, function linkReplace (p) {
return "<a href='" + p
+ "' target='_blank' onclick='var e=event||window.event;e.stopPropagation();e.cancelBubble=true;'>"
+ "' target='" + (_.controller.CONFIG["linksTarget"] || "_blank")
+ "' onclick='var e=event||window.event;e.stopPropagation();e.cancelBubble=true;'>"
+ p + "</a>";
});
} else if (!LISTING) { // number
Expand Down

0 comments on commit a06a02a

Please sign in to comment.