Skip to content

Commit 63acfa5

Browse files
hidden bug fix when wrong data source applied on empty dd/dt
1 parent 306c8f9 commit 63acfa5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

source/js/LightPivotTable.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,16 @@ LightPivotTable.prototype.pushDataSource = function (config) {
151151

152152
};
153153

154-
LightPivotTable.prototype.popDataSource = function () {
154+
/**
155+
* @param {boolean} [popData = true] - Also pop data in dataSource.
156+
*/
157+
LightPivotTable.prototype.popDataSource = function (popData) {
155158

156159
if (this._dataSourcesStack.length < 2) return;
157160

158161
this.DRILL_LEVEL--;
159162
this._dataSourcesStack.pop();
160-
this.dataController.popData();
163+
if (!popData) this.dataController.popData();
161164

162165
this.dataSource = this._dataSourcesStack[this._dataSourcesStack.length - 1];
163166

@@ -222,7 +225,7 @@ LightPivotTable.prototype.tryDrillDown = function (filter) {
222225
});
223226
}
224227
} else {
225-
_.popDataSource();
228+
_.popDataSource(true);
226229
}
227230
});
228231

@@ -263,7 +266,7 @@ LightPivotTable.prototype.tryDrillThrough = function (filters) {
263266
});
264267
}
265268
} else {
266-
_.popDataSource();
269+
_.popDataSource(true);
267270
}
268271
});
269272

0 commit comments

Comments
 (0)