Skip to content

Commit 0bdcb80

Browse files
fixed unimplemented behavior when Drilling Down without filters
1 parent d020cca commit 0bdcb80

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LightPivotTable",
33
"author": "ZitRo",
4-
"version": "1.3.1",
4+
"version": "1.3.2",
55
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
66
"main": "test/testServer.js",
77
"repository": {

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Then use global object constructed from <i>LightPivotTable</i>:
3636
var setup = { // Object that contain settings. Properties in brackets can be missed.
3737
container: document.getElementById("pivot") // HTMLElement which will contain table.
3838
[, locale: "en" ] // language to use (default: browser default or "en")
39-
logs: false, // enable logs
39+
[, logs: false ] // logging disabled by default
4040
, dataSource: {
4141
MDX2JSONSource: "http://localhost:57772/SAMPLES", // MDX2JSON server address
4242
basicMDX: typeof req === "object" ? req.basicMDX : req

source/js/MDXParser.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ MDXParser.prototype.prependNonEmpty = function (expression) {
4949
MDXParser.prototype.drillDown = function (mdx, filter, expression) {
5050

5151
if (!filter) {
52-
this._warnMDX(mdx, "no filter specified");
53-
return "";
52+
if (/]\s+ON\s+1/.test(mdx)) {
53+
return mdx = mdx.replace(/]\s+ON\s+1/, "].children ON 1");
54+
} else {
55+
this._warnMDX(mdx, "no filter specified");
56+
return "";
57+
}
5458
}
5559

5660
var parts = mdx.split(/(select\s*)(.*?)(\s*from)/ig); // split by SELECT queries
@@ -133,6 +137,6 @@ MDXParser.prototype.mdxType = function (mdx) {
133137
*/
134138
MDXParser.prototype.applyFilter = function (basicMDX, filterSpec) {
135139

136-
return basicMDX + " %FILTER " + filterSpec;
140+
return basicMDX + (filterSpec ? " %FILTER " + filterSpec : "");
137141

138142
};

0 commit comments

Comments
 (0)