如何一次过滤具有多个值的商店? [英] How to filter a store with multiple values at once?
本文介绍了如何一次过滤具有多个值的商店?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助!
谢谢!
解决方案
有点清洁:
var store = grid.getStore();
var selectedItems = csvList.split(,); //您的逗号分隔值列表
store.clearFilter();
store.filterBy(function(record,id){
return Ext.Array.indexOf(selectedItems,record.get(value))!== -1;
} );
I have a Store attached to a grid with number of records. I have a combo box with mulitiSelect option. So whenever i select multiple values in the Combo box. the grid must be filtered with all the criteria provided. I can get the values from the combo box as comma separated values but unable to send them to store's filter config.
Please Help!
Thanks!
解决方案
A bit cleaner:
var store = grid.getStore();
var selectedItems = csvList.split(","); //your list of comma separated values
store.clearFilter();
store.filterBy(function(record, id){
return Ext.Array.indexOf(selectedItems, record.get("value")) !== -1;
}, this);
这篇关于如何一次过滤具有多个值的商店?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文