Threaded View

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Mülheim an der Ruhr, Germany
    Posts
    79
    Vote Rating
    0
    Answers
    5
    blade226 is on a distinguished road

      0  

    Post Answered: Newbie question: Use a TreeStore as menu

    Answered: Newbie question: Use a TreeStore as menu


    Hello,

    i build a small Site (Viewport). In west is a treepanel und in center a tabpanel. Now i want to click on a part of the treepanel and a new tab should be open.
    I searched for a solution in sencha examples, but i don't get it right.

    Code:

    var west = Ext.create ("xwest",{
    region: "west",
    items : [ {
    xtype : "panel",
    region : "west",
    width : 200,
    items :[

    {
    xtype : "treepanel",
    store: treestore
    }]

    }]
    });

    var mitte = Ext.create ("xmitte",{
    region: "center",
    items : [{
    xtype : "tabpanel",
    id : 'tabs',
    activeTab: 0,
    items : [

    {
    title : "Diagramm",
    height : "100%",
    width : "100%",
    closable: true,
    items: [diagr]

    },
    {
    title : "Daten",
    closable: true,
    items: [artikelGrid]
    }
    ]
    }


    ]
    });

    Please: I need help

    THX

  2. Try this...
    PHP Code:
    {
            
    xtype 'treepanel',
            
    store treestore,
            
    listeners : {
                
    'select' : function(rowmodelrecord) {
                    
    mitte.getComponent('tabs').add({title record.get('Name'), itemId record.getId()});
                }
             }            


Thread Participants: 1