我在XML视图中使用搜索字段。SAPUI5搜索字段实时搜索不会过滤
<Page title="Title">
<subHeader>
<Toolbar>
<SearchField
liveChange="onSearch"
width="100%" />
</Toolbar>
</subHeader>
<content>
<List id = "oProductList" items="{/formset}" select="whencliekedonlist" mode="SingleSelectMaster">
<items>
<StandardListItem title="{orderno}"
description="{date}">
</StandardListItem>
</items>
</List>
</content>
</Page>
在我声明中的OData模型
onInit: function() {
//Declaring the model
var oProductModel = new sap.ui.model.odata.ODataModel("/sap/opu/odata/SOL/TEST_SRV");
sap.ui.getCore().setModel(oProductModel);
debugger;
},
我列出的顺序在画面分割应用母版页没有的视图的Init方法。
现在实况搜索我打电话这种方法,设置文件管理器
> debugger;
> // add filter for search
> var aFilters = [];
> var sQuery = oEvt.getSource().getValue();
> if (sQuery && sQuery.length > 0) {
> //here name is the field on which the filter has to be done.
> var filter = new sap.ui.model.Filter("orderno", sap.ui.model.FilterOperator.Contains, sQuery);
> aFilters.push(filter);
> }
>
>
>
> // update list binding
>
> var list = this.getView().byId("oProductList");
> var binding = list.getBinding("items");
> binding.filter(aFilters);
问题:我没有得到的结果filtered.Nothing发生时筛选。 我是否正在使用odata模型是因为它?如果是这样,如何继续您可以指向我的代码