1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    3
    Vote Rating
    0
    oncom is on a distinguished road

      0  

    Default Answered: How to show content in layout after click tree node

    Answered: How to show content in layout after click tree node


    Hello everybody,
    i am stuck here.

    i have a tree like this

    MyTree.js
    Code:
    var store = Ext.create('Ext.data.TreeStore', {
        proxy: {
            type: 'ajax',
            url: 'application/controllers/itemlist.php',
            node: 'id'
        },
        root: {
            text: 'Root Node',
            id: 'root_node',
            expanded: true
        }
    });
    
    
    var treePanel = Ext.create('Ext.tree.Panel', {
        id: 'tree-panel',
        region:'north',
        autoHeight: true, 
        minSize: 150,
        rootVisible: false,
        border: false,
        flex: 3,
        store: store
    });
    
    
    var detail = Ext.create('Ext.panel.Panel', {
        title: 'Details',
        region: 'south',
        height: 240,
        border: false,
        bodyStyle: 'padding: 5px;',
        autoScroll: true,
        flex: 1,
        html: '<p style="margin: 5px;">When you select a layout from the tree, additional details will display here.</p>'
    });    
    
    
    Ext.define('AM.view.layout.MyTree', {
        extend: 'Ext.container.Container',
        alias: 'widget.mytreepanel',
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        items: [ treePanel, detail ]
    });
    the tree is in region 'west', so when i click the node tree, i want to display tab panel in the center.

    for code in the tab panel is

    MyContent.js
    Code:
    Ext.define('AM.view.layout.MyContent', {
        extend: 'Ext.panel.Panel',
        alias: 'widget.contentpanel',
        
        activeItem: 0, 
        layout: {
            type: 'card',
            deferredRender: true
        },
        border: false,
        region: 'center'
    });
    how do i make it happen?

  2. I see you are using the region config but then using vbox layout. The region config will only work for border layout. You can add/remove items to a center region of a border layout.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I see you are using the region config but then using vbox layout. The region config will only work for border layout. You can add/remove items to a center region of a border layout.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    3
    Vote Rating
    0
    oncom is on a distinguished road

      0  

    Default


    thank you a lot, Mitchell. finally fix this problem.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar