Skip to content

Commit 53ef15f

Browse files
default widget filters, selection styles change
1 parent 0301f7b commit 53ef15f

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

export/LightPivotTable-DeepSeePortlet.xml

Lines changed: 11 additions & 2 deletions
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>63564,79829.955132</TimeChanged>
14+
<TimeChanged>63565,62684.158342</TimeChanged>
1515
<TimeCreated>63515,61322.546099</TimeCreated>
1616

1717
<Parameter name="INCLUDEFILES">
@@ -143,6 +143,7 @@
143143
widget = this, // It's lie. It changes later.
144144
widgetKey,
145145
i, info = {},
146+
defaultFilters = [],
146147
exportToExcel = !!parseInt(container.getAttribute("export-csv"));
147148
148149
// !ultra-bydlocode (get the widget object)
@@ -209,14 +210,22 @@
209210
}
210211
}
211212
//console.log(info);
213+
if (info.controls instanceof Array) {
214+
for (i in info.controls) {
215+
if (info.controls[i].action === "applyFilter" && info.controls[i].value) {
216+
defaultFilters.push(info.controls[i].targetProperty + "." + info.controls[i].value);
217+
}
218+
}
219+
}
212220
setup = {
213221
container: container,
214222
dataSource: {
215223
pivot: info["dataSource"],
216224
MDX2JSONSource: source,
217-
basicMDX: info["mdx"]
225+
basicMDX: info["basemdx"] || info["mdx"]
218226
}
219227
}
228+
if (defaultFilters.length) { setup["defaultFilterSpecs"] = defaultFilters; }
220229
if (controller && controller["data"] && controller["data"]["rowCaptions"] && typeof controller["data"]["rowCaptions"][0] === "string") setup.caption = controller["data"]["rowCaptions"][0];
221230
if (controller && controller["data"] && !setup.caption) setup.caption = controller["data"]["defaultCaption"] || "";
222231
if (info["drillDownDataSource"]) setup["drillDownTarget"] = info["drillDownDataSource"];

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ var setup = { // Object that contain settings. Any setting may be missed.
5959
[ , conditionalFormattingOn: true ] // pass false to turn off conditional formatting
6060
[ , loadingMessageHTML: "LOADING DATA..." ] // HTML displaying during data load
6161
[ , enableHeadersScrolling: false ] // enable scrolling both for table and headers. Useful for mobile devices.
62+
[ , defaultFilterSpecs: ["[Date].[H1].[month].&[]"] ] // default filters array
6263
[ , drillDownTarget: "<dashboard name>" ] // deepSee only - dashboard to open
6364
},
6465
lp = new LightPivotTable(setup);

source/css/LightPivot.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
}
5050

5151
.lpt tr:hover td {
52-
background: #FFF7D7;
52+
box-shadow: inset 0 0 30px #FFF7D7;
5353
}
5454

5555
.lpt table td:hover {
56-
background: #FFEEAA;
56+
box-shadow: inset 0 0 20px #FEA;
5757
}
5858

5959
/* DeepSee theme */

source/js/LightPivotTable.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ var LightPivotTable = function (configuration) {
4747
*/
4848
LightPivotTable.prototype.refresh = function () {
4949

50-
var _ = this;
50+
var _ = this,
51+
i;
52+
53+
if (this.CONFIG["defaultFilterSpecs"] instanceof Array) {
54+
for (i in this.CONFIG["defaultFilterSpecs"]) {
55+
this.setFilter(this.CONFIG["defaultFilterSpecs"][i]);
56+
}
57+
}
5158

5259
this.dataSource.getCurrentData(function (data) {
5360
if (_.dataController.isValidData(data)) {

0 commit comments

Comments
 (0)