Skip to content

Commit 1f3cef0

Browse files
authored
Merge pull request #89 from mendix/feat/lvc-dropdown-filter-state
[WC-386]: include the previous constraints when setting new ones
2 parents e1cfe0b + 59eec2b commit 1f3cef0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "list-view-controls",
33
"widgetName": "ListViewControls",
4-
"version": "1.3.10",
4+
"version": "1.3.11",
55
"description": "Search and filter Mendix list views",
66
"copyright": "Mendix BV",
77
"scripts": {

src/Shared/DataSourceHelper/DataSourceHelper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class DataSourceHelper {
125125
}
126126

127127
private updateDataSource(callback: () => void, restoreState: boolean) {
128-
let constraints: Constraints = [];
128+
let constraints: Constraints;
129129
let sorting: string[][] = Object.keys(this.store.sorting)
130130
.map(key => this.store.sorting[key])
131131
.filter(sortConstraint => sortConstraint[0] && sortConstraint[1]);
@@ -161,6 +161,7 @@ export class DataSourceHelper {
161161
}
162162
}
163163

164+
// TODO: Since we do not include `this.widget_datasource._constraints` here, this can cause filtering to reset all the constraints.
164165
constraints = [ ...unGroupedConstraints, ...unGroupedOrConstraints, ...groupedConstraints ];
165166

166167
} else {
@@ -178,7 +179,7 @@ export class DataSourceHelper {
178179
.join("")
179180
.replace(/\[]/g, ""); // Remove empty string "[]"
180181

181-
constraints = unGroupedConstraints + groupedConstraints;
182+
constraints = this.widget._datasource._constraints + unGroupedConstraints + groupedConstraints;
182183
// if (!restoreState) {
183184
// this.widget._datasource._sorting = sorting;
184185
// }

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="ListViewControls" version="1.3.10" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="ListViewControls" version="1.3.11" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="CheckBoxFilter/CheckBoxFilter.xml"/>
66
<widgetFile path="DropDownFilter/DropDownFilter.xml"/>

0 commit comments

Comments
 (0)