1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    10
    Answers
    1
    Vote Rating
    1
    GuillaumeF is on a distinguished road

      0  

    Default Answered: How to get TreeStore or TreePanel when an itemAppend event occurs ?

    Answered: How to get TreeStore or TreePanel when an itemAppend event occurs ?


    Hi,

    Using ExtJS 4.1, how to get TreeStore or TreePanel when an itemAppend event occurs ?
    I don't see any reference to the TreeStore or the Panel during the event nor the nodes attributes.

    See below the code that doesn't work.

    Note there is not only one ContainersTree. Multiple ones can be created, each one is displayed in a separate tab of a TabPanel.

    Regards,

    Guillaume

    VIEW :
    Code:
    Ext.define('Link.view.module.ContainersTree', {
            extend: 'Ext.tree.Panel',
            alias: 'widget.ModuleContainersTree',
    
            initComponent: function() {
                this.store = Ext.create('Ext.data.TreeStore', {
                        model: 'Link.model.Container',
                ...
                }
                this.relayEvents(this.store, ['load', 'append'], 'store');
                this.callParent(arguments);
            },
    ...
    });
    CONTROLLER :
    Code:
    Ext.define('Link.controller.module.Edit', {
        extend: 'Ext.app.Controller',
    
        views: [ 'module.ContainersTree'],
    
        models: ['Container'],
    
        init: function() {
            this.control({
                    'ModuleContainersTree': {
                        itemappend: function(parentNode, childNode) {
                            // HOW TO GET THE ModuleContainersTree PANEL HERE ?
                        },
                        storeappend: function(parentNode, childNode) {
                            // HOW TO GET THE TREESTORE HERE ?
                        }
                    }
            });
        ...
    });

  2. I got it. It works.

    The node, which is also an Ext.data.Model, had a "store" attribute.

    CONTROLLER :
    Code:
    ...
    
    this.control({
        'ModuleContainersTree': {
            storeappend: function(parentNode, childNode) {
                var nodeStore = parentNode.store; // It is an Ext.data.NodeStore object
                var treeStore = nodeStore.treeStore;  // Here it is the tree store
                ...
            }
        }
    });
    ...
    Hope it can help.

  3. #2
    Sencha User
    Join Date
    May 2010
    Posts
    10
    Answers
    1
    Vote Rating
    1
    GuillaumeF is on a distinguished road

      0  

    Default


    I got it. It works.

    The node, which is also an Ext.data.Model, had a "store" attribute.

    CONTROLLER :
    Code:
    ...
    
    this.control({
        'ModuleContainersTree': {
            storeappend: function(parentNode, childNode) {
                var nodeStore = parentNode.store; // It is an Ext.data.NodeStore object
                var treeStore = nodeStore.treeStore;  // Here it is the tree store
                ...
            }
        }
    });
    ...
    Hope it can help.

  4. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thank you for providing the solution.

    Scott.

Thread Participants: 1

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