on 01-19-2016 6:35 PM
Hi experts,
I have a MultiInput bind to a OData Model which shows suggestion. Can I filter those suggestions by a value of another control?
Here for an example I have two datePickers and MultiInput and I would like to filter the suggestion list by the values from datePickers
<Label text="Date range filter" labelFor="filterDateRangeSelection"/>
<l:HorizontalLayout class="sapUiContentPadding" width="100%" id="filterDateRangeSelection">
<l:content>
<DatePicker
id="filterDateFrom"
displayFormat="short"
class="sapUiSmallPaddingBegin"
change="onChangeFilterDateFrom"
/>
<DatePicker
id="filterDateTo"
displayFormat="short"
change="onChangeFilterDateTo"
class="sapUiSmallMarginBegin sapUiSmallPaddingEnd"
/>
</l:content>
</l:HorizontalLayout>
<Label text="Names" labelFor="filterPlanNames"/>
<MultiInput id="filterPlanNames"
suggestionItems="{
path: 'plan>/PlansSet',
sorter: { path: 'plan>Name' },
filter: VALUES-FROM-DATE-PICKER-ABOVE
}"
showValueHelp="false"
placeholder="{i18n>filter.dialog.planNames.placeHolder}"
enableMultiLineMode="false" >
<core:Item key="{plan>TestPlanIds}" text="{plan>Name}" />
</MultiInput>
Kind regards,
Filip
Depending on what your model supports, define a function in the controller with...
var aFilters = [];
aFilters.push(new Filter("ColName", sap.ui.model.FilterOperator.BT, from, to));
this.getView().byId("filterPlanNames").getBinding("suggestionItems").filter(aFilters);
Regards,
Jamie
SAP - Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.