我想按数组过滤store而不仅仅是单个值,我使用filterBy,但它不起作用。你能帮帮我吗?
var properties = rec.get('properties').split(',');
var store = this.getPropertyStore().load();
store.clearFilter(false);
store.filterBy(function(record, id) {
return Ext.Array.contains(properties, record.get("idProperty"));
});
答案 0 :(得分:0)
加载是异步的,将过滤器放入加载事件:
var store = this.getPropertyStore().load();
store.clearFilter(false);
store.on('load',function(){
store.filterBy(function(record, id) {
return Ext.Array.contains(properties, record.get("idProperty"));
});
})