From dea08fb579c161dd24f1f6f247cf91c9264eb123 Mon Sep 17 00:00:00 2001 From: ZitRos Date: Mon, 27 Nov 2017 12:45:38 +0200 Subject: [PATCH] Fix undefined pivot property --- example/index.html | 12 ++++++++++-- package.json | 2 +- source/js/DataController.js | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/example/index.html b/example/index.html index cac9085..56b7554 100644 --- a/example/index.html +++ b/example/index.html @@ -86,7 +86,15 @@ { basicMDX: 'SELECT NON EMPTY {[Measures].[%COUNT],%LABEL([Measures].[Avg Age],"Avg Age (ex. 1)",""),%LABEL([Measures].[Avg Age],"Avg Age (ex. 2)",""),%LABEL([Measures].[Avg Age],"Avg Age (ex. 3)","")} ON 0,NON EMPTY [AllerSevD].[H1].[Allergy Severities].Members ON 1 FROM [Patients]', pivot: "Pivot Features/Conditional Formatting.pivot" - } + }, + { + basicMDX: 'SELECT NON EMPTY HEAD({NONEMPTYCROSSJOIN([Product].[P1].[Product Category].&[Pasta],[Measures].[Units Sold]),NONEMPTYCROSSJOIN([Product].[P1].[Product Category].&[Pasta],[Measures].[Amount Sold])},2000,SAMPLE) ON 1 FROM [HOLEFOODS]', + pivot: 'OH/Measure labels displayed.pivot' + }, + { + basicMDX: 'SELECT NON EMPTY HEAD({NONEMPTYCROSSJOIN([Product].[P1].[Product Category].&[Pasta],[Measures].[Units Sold]),NONEMPTYCROSSJOIN([Product].[P1].[Product Category].&[Pasta],[Measures].[Amount Sold])},2000,SAMPLE) ON 1 FROM [HOLEFOODS]', + pivot: 'OH/Measure labels ommitted.pivot' + } ][v], setup; @@ -98,7 +106,7 @@ container: document.getElementById("pivot") // HTMLElement which will contain table. //, locale: "en" // language to use (default: browser default or "en") , dataSource: { - MDX2JSONSource: "http://" + location.hostname + ":57776/MDX2JSON" + MDX2JSONSource: "http://" + location.hostname + ":57772/MDX2JSON" //MDX2JSONSource: "http://37.139.4.54/MDX2JSON" // MDX2JSON server address , basicMDX: typeof req === "object" ? req.basicMDX : req diff --git a/package.json b/package.json index 8976fd4..dffaac2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "LightPivotTable", "author": "ZitRo", - "version": "1.8.11", + "version": "1.8.12", "description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache", "main": "test/testServer.js", "repository": { diff --git a/source/js/DataController.js b/source/js/DataController.js index 8e7ac97..b614356 100644 --- a/source/js/DataController.js +++ b/source/js/DataController.js @@ -867,7 +867,7 @@ DataController.prototype.modifyRawData = function (data) { var y = data.info.topHeaderRowsNumber - 1; for (i = data.info.leftHeaderColumnsNumber; i < data.rawData[y].length; i++) { data.rawData[y][i].style = "min-width:" - + (this.controller.CONFIG.pivotProperties["cellWidth"] || 100) + "px;" + + (this.controller.getPivotProperty(["cellWidth"]) || 100) + "px;" + (data.rawData[y][i].style ? data.rawData[y][i].style : ""); }