So here is the plugin that I'm using for slidenavigation: slidenavigation, and I would like to remove all items on painted method.
It seems that items are stored in this.data.items
. However clearing an array doesn't solve an issue.
CLearing the store didn't as well. So here is the painted method to initialise the items and push them to the plugin
Ext.define("APN.view.FlyoutNavigation", { id: "flyoutNavigationPanel", extend: 'Ext.ux.slidenavigation.View', }, listeners: { painted: function() { this.store.clear() this.store.data.clear() this.store.items = [] var arrItems = [ .. heaps of items in here ] this.addItems(arrItems); }, },
And in the plugin addItems
method:
addItems: function(items) { console.log("data from addItems:") console.log(this.store) var me = this, items = Ext.isArray(items) ? items : [items], groups = me.config.groups; Ext.each(items, function(item, index) { if (!Ext.isDefined(item.index)) { item.index = me._indexCount; me._indexCount++; } me.store.add(item); console.log("data from addItems after adding:") console.log(me.store.data.all.length) }); console.log("data from addItems after adding:") console.log(this.store) },