2013-10-18 102 views
1

我有以下代碼。Sencha touch列表清潔數據

var list = this.getNavigation(); 
if (list.itemsCount > 0) { 
    list.removeAll(true, true); 
} 
list.setData(filtered); 

List = xtype:list。 所以想法是接下來我有菜單,有時我需要重建它。因爲你看到我沒有使用商店,因爲我需要過濾數組並設置它。 當我打電話的removeAll我得到錯誤

Uncaught TypeError: Cannot call method 'getScroller' of undefined 

,我不能找到方法來清除它...

+0

你在名單後面有商店嗎? –

+0

不,我只是使用setData設置數組 –

+1

爲什麼不過濾商店中的數據? – kio21

回答

0

我改寫了我的菜單使用商店,而不是使用setData名錄我設置的存儲和數據它按預期工作

0

另一種辦法是用呼喚摧毀設置爲false像這樣的removeAll:

var list = this.getNavigation(); 
if (list.itemsCount > 0) { list.removeAll(false); } 
list.setData(filtered); 

名單DOM它通過某種自動清理,ems會被刪除。