Search code examples
sencha-touchsencha-touch-2

Sencha touch List clean data


I have following code.

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

List = xtype: list. So idea is next i have menu and some times i need to rebuild it. as you see i am not using store because i need to filter array and set it. When i call removeAll i got error

Uncaught TypeError: Cannot call method 'getScroller' of undefined 

And i cant find method to cleanup it...


Solution

  • I rewrote my menu to use store and instead of setData on list i am setting data on store and it works as expected