on 2022 Oct 24 10:43 PM
Hi,
I am working on sap.m.table and trying to implement Filter for all columns.
I am trying to implement Filter like sap.ui.table.table where clicking a column will show Input box to provide filter value. But the examples available are only for selecting individual entries to filter but not to get input value.
I tried using custom controls which displays input fields but the function isn't taking up the user provided values.
Can someone please point out appropriate or working code to fix it ? Any code through jsbin highly valuable and appreciate your help.
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core">
<ViewSettingsDialog id="filterDialog"
confirm="handleFilterDialogConfirm">
<filterItems>
<ViewSettingsCustomItem id="idCustomFilterItem1" key="Key1" text="Text1">
<customControl>
<Input value=""/>
</customControl>
</ViewSettingsCustomItem>
<ViewSettingsCustomItem id="idCustomFilterItem2" key="Key2" text="Text2">
<customControl>
<Input value=""/>
</customControl>
</ViewSettingsCustomItem>
</filterItems>
</ViewSettingsDialog>
</core:FragmentDefinition>
handleFilterDialogConfirm: function (oEvent) {
var oTable = this.byId("idTable"),
mParams = oEvent.getParameters(),
oBinding = oTable.getBinding("items"),
aFilters = [];
// Here mParams.filterItems is retrieved as empty array.
mParams.filterItems.forEach(function(oItem) {
var sPath = oItem.getKey(),
sValue1 = ''
oFilter = new Filter(sPath, 'EQ', sValue1);
aFilters.push(oFilter);
});
// apply filter settings
oBinding.filter(aFilters);
},
Thanks in advance.
User | Count |
---|---|
68 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.