diff --git a/packages/fiori/src/ViewSettingsDialog.ts b/packages/fiori/src/ViewSettingsDialog.ts index 61554759773d..3c799f85af14 100644 --- a/packages/fiori/src/ViewSettingsDialog.ts +++ b/packages/fiori/src/ViewSettingsDialog.ts @@ -561,9 +561,26 @@ class ViewSettingsDialog extends UI5Element { return filter; }); + this._setSelectedProp(e); + this._currentSettings = JSON.parse(JSON.stringify(this._currentSettings)); } + /** + * Sets the selected property of the clicked item. + * @param e + * @private + */ + _setSelectedProp(e: CustomEvent) { + this.filterItems.forEach(filterItem => { + filterItem.values.forEach(option => { + if (option.text === e.detail.item.innerText) { + option.selected = !option.selected; + } + }); + }); + } + _navigateToFilters() { this._filterStepTwo = false; } @@ -624,6 +641,7 @@ class ViewSettingsDialog extends UI5Element { sortBy, sortByItem, filters: this.selectedFilters, + filterItems: this.filterItems, }; } diff --git a/packages/fiori/test/pages/ViewSettingsDialog.html b/packages/fiori/test/pages/ViewSettingsDialog.html index a8c22d46df9f..c61dd95714fe 100644 --- a/packages/fiori/test/pages/ViewSettingsDialog.html +++ b/packages/fiori/test/pages/ViewSettingsDialog.html @@ -93,7 +93,75 @@

ViewSettingsDialog

+

ViewSettingsDialog with dataset properties

+ + Show ViewSettingsDialog + + + + + + + + + + + + + + + + +