cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.table - Filter Dialog - Input field to accept user value isn't retrieving data

SAPSeeker
Participant
335

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.

Accepted Solutions (0)

Answers (0)