[英]Sencha Touch : Applying multiple filter to store
我想根据我的ID的多个选择来刷新sencha touch中的列表。
我已经根据所选ID对我的商店实施了过滤器,因此当用户单击每个ID时,列表将刷新,代码如下所示。
control: {
MaterialscategoryList:{
itemtap: "refreshList"
},
refreshList:function (list, index, target, record){
console.log("record id is " +record.get('id'));
if(record.get('id') == 1 ){
Ext.getStore('materialsid').filter('categoryId', '1');
}else if(record.get('id') == 2 ){
Ext.getStore('materialsid').filter('categoryId', '2');
}else if(record.get('id') == 3 ){
Ext.getStore('materialsid').filter('categoryId', '3');
}else if(record.get('id') == 4 ){
Ext.getStore('materialsid').filter('categoryId', '4');
}else if(record.get('id') == 5 ){
Ext.getStore('materialsid').filter('categoryId', '5');
}else if(record.get('id') == 6 ){
Ext.getStore('materialsid').filter('categoryId', '6');
}
},
我有一个场景,用户将选择多个ID,而我想应用过滤器。不确定如何继续。 任何帮助深表感谢。
var store = Ext.getStore('materialsid');
store.filter(function(record){
var id = record.get('categoryId');
return (id == 1 || id == 2 || id == 3); // you can pass your selected Ids here
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.