1. #11
    Sencha Premium Member
    Join Date
    Apr 2011
    Posts
    101
    Answers
    8
    Vote Rating
    3
    sskow200 is on a distinguished road

      0  

    Default solved?

    solved?


    I am not quite understanding why this seems so complicated and obtuse, but here it goes...

    Code:
        Ext.define('MyTreeStore', {
            extend: 'Ext.data.TreeStore',
            root: {
                expanded: true,
                children: [{
                        text: 'Record 1',
                        leaf: true
                    },{ 
                        text: 'Record 2',
                        leaf: true
                    },{ 
                        text: 'Record 3',
                        leaf: false,
                        children: [{
                                text: 'Child 1',
                                leaf: true
                            },{ 
                                text: 'Child 2',
                                leaf: true
                        }]  
                }]  
            },  
    
            onNodeAdded: function(parent, node) {
                this.callParent(arguments);
    
                //put the instance of the store in the node
                node.myStore = this;
            }   
        }); 
    
        Ext.define('MyTreePanel', {
            extend: 'Ext.tree.Panel',
            title: 'Parent Tree',
            width: 400,
            height: 400,
            rootVisible: false,
            renderTo: Ext.getBody(),
    
            initComponent: function() {
                this.callParent(arguments);
                 
                //put tree reference in the store
                this.store.myTree = this;
    
                this.on('itemclick', this.onTreeNodeSelect, this);
            },  
    
            onTreeNodeSelect: function(view, record, item, idx, evt) {
                console.log(record.myStore);
                console.log(record.myStore.myTree);
            }   
        }); 
        
    
    Ext.onReady(function(){
        Ext.create('MyTreePanel', {
            store: Ext.create('MyTreeStore')
        });    
    });
    Hope that helps...

  2. #12
    Sencha User
    Join Date
    Jan 2012
    Posts
    22
    Vote Rating
    0
    dee1 is on a distinguished road

      0  

    Default


    Thanks @Romick a variant of that worked
    @sskow200 pointing out the onNodeAdded function is exactly what I needed - thanks, it's appreciated

Thread Participants: 3

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi