2013-07-17 27 views
3

我有一個商店附加到記錄數量的網格。我有一個組合框與mulitiSelect選項。所以每當我在組合框中選擇多個值。網格必須按照提供的所有標準進行過濾。我可以從組合框中獲取值作爲逗號分隔值,但無法將它們發送到商店的過濾器配置。如何一次過濾多個值的商店?

請幫忙!

謝謝!

回答

13

有點清潔:

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); 
+0

非常感謝邁克。有用! :) –

+0

不客氣:)如果答案是正確的,你能接受嗎?謝謝! – Mike

+0

當然,我做到了。 :) –

相關問題