Hi there,

i need a way to copy a complete filled Treestore to a localstore. For this i create a TreeStore (secondTreeStore) with a localstorage-proxy. Then i try many things like:

PHP Code:
firstTreeStore.on('load', function(storerecords) {
    
secondTreeStore.removeAll();
    
secondTreeStore.add(records);
    
secondTreeStore.sync();
}) 
This will not work...

Then i try:

PHP Code:
firstTreeStore.on('load', function(store) {
    var 
nodes = [];
 
   
Ext.Array.each(store.getRoot().childNodes, function(node) {
        
nodes.push(node.copy(nullnulltrue));
    }

    
secondTreeStore.removeAll();
    
secondTreeStore.sync();

    
secondTreeStore.getRoot().appendChilde(nodes);
    
secondTreeStore.sync();
}) 
This will store something in the localstorage, but when the first store will be refilled, the id´s and counter values are wrong.

What is the correct way to copy deep a TreeStore?


Bye, Dumbledore