Skip to content

Commit

Permalink
drillDownTarget support (moving to another dashboard)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Nov 29, 2014
1 parent 04d2e85 commit dcf84a8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
MDX2JSONSource: "http://localhost:57772/SAMPLES", // MDX2JSON server address
basicMDX: typeof req === "object" ? req.basicMDX : req
}
//, drillDownTarget: "<dashboard name>" - undocumented, deepSee only
};

if (req.DrillDownExpression) { // set custom DrillDown on variant 10
Expand Down
13 changes: 10 additions & 3 deletions export/LightPivotTable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@

<Class name="DeepSee.LightPivotTable">
<Super>%DeepSee.Component.Portlet.abstractPortlet</Super>
<TimeChanged>63520,75672.654316</TimeChanged>
<TimeChanged>63521,5059.885023</TimeChanged>
<TimeCreated>63515,61322.546099</TimeCreated>

<Parameter name="INCLUDEFILES">
<Default>style:DeepSeeLightPivotTable.css,script:DeepSeeLightPivotTable.js</Default>
</Parameter>

<Property name="DataSource">
<Type>%String</Type>
</Property>

<Method name="%OnGetPortletName">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
Expand Down Expand Up @@ -162,14 +166,15 @@
}
}
//console.log(info);
//console.log(_.getConnectedController());
//console.log(AA = _.getConnectedController());
setup = {
container: container,
dataSource: {
MDX2JSONSource: source,
basicMDX: info["mdx"]
}
}
if (info["drillDownDataSource"]) setup["drillDownTarget"] = info["drillDownDataSource"];
post(source + "/DataSource", { DataSource: info["dataSource"] }, function (data) {
//console.log(data);
Expand All @@ -192,8 +197,10 @@
<Implementation><![CDATA[
set ..renderFlag = ..renderFlag + 1
set ..DataSource = $get(..settings("dataSource"))
&html<
<div data-source="#(..settings("dataSource"))#" class="lpt-container" style="position: absolute; left: 0; bottom: 0; width: 100%; height: 100%;">
<div data-source="#(..DataSource)#" class="lpt-container" style="position: absolute; left: 0; bottom: 0; width: 100%; height: 100%;">
</div>
>
Expand Down
8 changes: 7 additions & 1 deletion source/js/PivotView.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@ PivotView.prototype._cellClickHandler = function (x, y) {
console.warn("Unable to get filters for cell (%d, %d)", x, y);
}

this.controller.showDrillThrough([f1, f2]);
if (this.controller.CONFIG["drillDownTarget"]) {
window.location = location.origin + location.pathname + "?DASHBOARD="
+ encodeURIComponent(this.controller.CONFIG["drillDownTarget"]) + "&SETTINGS=FILTER:"
+ encodeURIComponent(f1 + "~" + f2) + ";";
} else {
this.controller.showDrillThrough([f1, f2]);
}

};

Expand Down

0 comments on commit dcf84a8

Please sign in to comment.