Steps to reproduce:

(1) Create an infinite list

(2) Bind it to a store

(3) Bind it to a different store


The first pass:



Code:




Ext.dataview.List#updateAllListItems (sencha-touch-all.js:71406)
Ext.dataview.List#onStoreClear (sencha-touch-all.js:71664)
Ext.dataview.DataView#updateStore (sencha-touch-all.js:55447)
Ext.Base#callOverridden (sencha-touch-all.js:4838)
Ext.dataview.DataView#updateStore (sencha-touch-all.js:15936)
Ext.dataview.DataView#setStore (sencha-touch-all.js:5557)


The second [redundant] pass:

Code:




Ext.dataview.List#updateAllListItems (sencha-touch-all.js:71406)
Ext.dataview.List#doRefresh (sencha-touch-all.js:71447)
Ext.event.Controller#doFire (sencha-touch-all.js:15440)
Ext.event.Controller#fire (sencha-touch-all.js:15367)
Ext.event.Dispatcher#doDispatchEvent (sencha-touch-all.js:15865)
Ext.event.Dispatcher#dispatchEvent (sencha-touch-all.js:15846)
Ext.mixin.Observable#doFireEvent (sencha-touch-all.js:16211)
Ext.mixin.Observable#fireAction (sencha-touch-all.js:16196)
Ext.dataview.DataView#refresh (sencha-touch-all.js:55537)
Ext.dataview.DataView#updateStore (sencha-touch-all.js:55473)
Ext.Base#callOverridden (sencha-touch-all.js:4838)
Ext.dataview.DataView#updateStore (sencha-touch-all.js:15936)
Ext.dataview.DataView#setStore (sencha-touch-all.js:5557)




What is expected:

When an infinite list's store is updated, the list is refreshed once.


What happens instead:


The list is refreshed twice.


Solution:


Ext.dataview.DataView#updateStore refreshes the list items through a call to #onStoreClear and a call to #refresh. These two paths lead to a call to #updateAllListItems. So a condition needs to be added to #updateStore to prevent both methods from being called; Or, a flag needs to be passed to onStoreClear to prevent the refreshing of the list items; Or, ...