Run a function after adding item to store of a tree

0

I have 2 Trees in my project made with ExtJs4, and one of the Trees is added value in store after an event. I would like to as soon as the value is added in the store of the first tree , the second re-updates with the new values of the first. As if it were a callBack after I use the appendChild function.

Code when I add value in the first Tree:

...
handler: function(){
            var treeProc = Ext.getCmp('int-proc').store;
            var ttP = treeProc.getRootNode();

            var treeInt = Ext.getCmp('int-int').store;
            var ttI = treeInt.getRootNode();

        Ext.each(ttI.childNodes, function(node){
            var plop = node.data['text'].substr(-3);
            var change = node.data['text'].replace(plop, 'doc');

            ttP.getChildAt(0).appendChild({
                txt: change,
                tipo: 'intimacao',
                id: "9898",
                data: '10/06/2014',
                leaf: true
            });
        });
        ttI.removeAll(true);
    }
   ...

The second tree has nothing, it only loads with the new values added in the first tree .

    
asked by anonymous 26.06.2014 / 14:41

0 answers