gpt4 book ai didi

javascript - 过滤 sap.m.List 中的 customListItem

转载 作者:行者123 更新时间:2023-11-28 19:04:09 26 4
gpt4 key购买 nike

我遇到了一个奇怪的过滤问题。当我使用标准列表项时,以下内容完美运行

new sap.ui.model.Filter(path,operator,value)

但是当我使用 customlistItem 时,它停止工作。我正在使用下面的代码进行过滤。

var list = sap.ui.getCore().byId("listToFilter");
var binding = list.getBinding("items");
var filter = new sap.ui.model.Filter("Description",sap.ui.model.FilterOperator.Contains , value);
binding.filter(filter,"Application"); binding.refresh(true);

我有一个复选框,其文本字段绑定(bind)到我在过滤器路径中传递的属性

var checkBox = new sap.m.CheckBox({                      
text: "{Description}",
selected:"{path: 'Selected', type:'sap.ui.model.type.String'}"
});

感谢任何有关如何实现这一目标的建议。

最佳答案

I have replicated your scenario and it is perfectly working fine for me.
Below is some sample code.

**view:**
<List
headerText="Custom Content"
id="IDCustomerListItem"
items = "{oAppView>/modelData}">
<CustomListItem type="Inactive">
<CheckBox text="{oAppView>lastName}" selected="true" />
</CustomListItem>
</List>

**Controller**:
var list,
binding,
filter;
list = this.getView().byId("IDCustomerListItem");
filter = new sap.ui.model.Filter("lastName",sap.ui.model.FilterOperator.Contains , "D");
binding = list.getBinding("items");
binding.filter(filter,"Application");
binding.refresh(true);

关于javascript - 过滤 sap.m.List 中的 customListItem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32007880/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com