I have defined a view from treepanel which user a store I extended from an async treestore. This treepanel is used in multiple places but the same data is always used. To minimise network traffic I have deliberately set all the treepanel to have a initComponent function which looks to see if a tree store exists and if I does use the existing tree store, if not then create and use it. I can't use just one component since it is slotted into various different layout with different sizes.
This works fine however it seems that when the store is first connected to the treepanel it is attached and loaded regardless of if the store already has data loaded.
So you can load a treepanel -> it creates and attached the treestore. This then load the first branch and works normally as treepanels do. If you swap to anther screen and a new treepanel is created -> it attaches the existing treestore but then seem to empty the store. So then the second treepanel then loads the treestore and first branch again and this then works too as you would expect any treepanel to.
From this point on they the 2 treepanel use the one store as you would expect; so if you open one branch it is automatically opened on the other treepanel also, (which is what I am after)
I know there is a clearOnLoad config you can set on the treestore but that didn't seem to do anything. It's not the end of the world but is there a way to stop the purge on creation of a new treepanel if it using an existing store?
Cheers,
Ben
Aucun commentaire:
Enregistrer un commentaire