on 06-10-2015 7:49 AM
Hi All,
I am adding custom filter for sap.m.Table based on search field input(input text must filter all columns data).
Which is the better way to approach from below;
1) Passing the search field text into the xsodata service using filter?
2) passing the search field text into the filter ? or any other way?
Regards,
Mj.
Hi Muni,
You can user View Settings Dialog - Standard functionality ( sap.m.ViewSettingsDialog). This will filter you model.
<headerToolbar> | |
<ToolbarSpacer></ToolbarSpacer> | |
<Button icon="sap-icon://drop-down-list" press="handleViewSettingsDialogButtonPressed" /> | |
</Toolbar> | |
</headerToolbar> |
handleViewSettingsDialogButtonPressed: function (oEvent)
{
if (!this._oDialog)
{
this._oDialog = sap.ui.xmlfragment("cgiPurchaseReq.view.Dialog", this);
}
jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this._oDialog);
this.getView().addDependent(this._oDialog);
this._oDialog.open();
},
Create a Fragment and pass the values you want to filter.
<?xml version="1.0" encoding="UTF-8"?>
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core">
<ViewSettingsDialog
confirm="handleConfirm">
<sortItems>
<ViewSettingsItem text="{i18n>TableItemCode}" key="Table>Matnr" selected="true" />
<ViewSettingsItem text="{i18n>TableProductBrand}" key="Table>Maktx" />
<ViewSettingsItem text="Uom" key="Table>Meins" />
</sortItems>
</ViewSettingsDialog>
</core:FragmentDefinition>
Please refer SAPUI5 Explored
Hope this will help you.
Thanks and Regards
Abhijeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sap.ui.model.Filter encapsulates $filter, so use filter on binding and odatamodel/binding will take of the rest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.