Skip to content

Commit a17c0b5

Browse files
custom DrillDown on higher levels support
1 parent 874e388 commit a17c0b5

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

export/LightPivotTable.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<Class name="DeepSee.LightPivotTable">
1313
<Super>%DeepSee.Component.Portlet.abstractPortlet</Super>
14-
<TimeChanged>63524,69651.14693</TimeChanged>
14+
<TimeChanged>63524,83748.41729</TimeChanged>
1515
<TimeCreated>63515,61322.546099</TimeCreated>
1616

1717
<Parameter name="INCLUDEFILES">
@@ -187,8 +187,7 @@
187187
//console.log(data);
188188
if (data["rowAxisOptions"]) {
189189
if (data["rowAxisOptions"]["drilldownSpec"]) {
190-
console.log(data["rowAxisOptions"]["drilldownSpec"]);
191-
setup.DrillDownExpression = data["rowAxisOptions"]["drilldownSpec"];
190+
setup.DrillDownExpression = data["rowAxisOptions"]["drilldownSpec"].split("^");
192191
}
193192
if (data["rowAxisOptions"]["levelFormat"] || data["columnAxisOptions"] && data["columnAxisOptions"]["levelFormat"]) {
194193
setup["formatNumbers"] = data["columnAxisOptions"]["levelFormat"] || data["rowAxisOptions"]["levelFormat"];

source/js/LightPivotTable.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var LightPivotTable = function (configuration) {
1212

1313
this._dataSourcesStack = [];
1414

15+
this.DRILL_LEVEL = -1;
1516
this.CONFIG = configuration;
1617

1718
this.mdxParser = new MDXParser();
@@ -84,6 +85,7 @@ LightPivotTable.prototype.pushDataSource = function (config) {
8485

8586
var newDataSource;
8687

88+
this.DRILL_LEVEL++;
8789
this._dataSourcesStack.push(newDataSource = new DataSource(config));
8890
this.dataSource = newDataSource;
8991

@@ -95,6 +97,7 @@ LightPivotTable.prototype.popDataSource = function () {
9597

9698
if (this._dataSourcesStack.length < 2) return;
9799

100+
this.DRILL_LEVEL--;
98101
this._dataSourcesStack.pop();
99102
this.dataController.popData();
100103

@@ -125,9 +128,13 @@ LightPivotTable.prototype.tryDrillDown = function (filter) {
125128
// clone dataSource config object
126129
for (var i in _.CONFIG.dataSource) { ds[i] = _.CONFIG.dataSource[i]; }
127130

128-
if (this.CONFIG.DrillDownExpression && this._dataSourcesStack.length < 2) {
131+
if (this.CONFIG.DrillDownExpression && !(this.CONFIG.DrillDownExpression instanceof Array)) {
132+
this.CONFIG.DrillDownExpression = [this.CONFIG.DrillDownExpression];
133+
}
134+
135+
if ((this.CONFIG.DrillDownExpression || [])[this.DRILL_LEVEL]) {
129136
ds.basicMDX = this.mdxParser.drillDown(
130-
this.dataSource.BASIC_MDX, filter, this.CONFIG.DrillDownExpression
137+
this.dataSource.BASIC_MDX, filter, this.CONFIG.DrillDownExpression[this.DRILL_LEVEL]
131138
) || this.dataSource.BASIC_MDX;
132139
} else {
133140
ds.basicMDX = this.mdxParser.drillDown(this.dataSource.BASIC_MDX, filter) || this.dataSource.BASIC_MDX;

source/js/PivotView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ PivotView.prototype.renderRawData = function (data) {
501501
td.className = "formatLeft";
502502
}
503503
if (data[y][x].style) {
504-
for (i in data[y][x].style) {
504+
for (var i in data[y][x].style) {
505505
td.style[i] = data[y][x].style[i];
506506
}
507507
}

0 commit comments

Comments
 (0)