1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    6
    Vote Rating
    0
    tah_206207 is on a distinguished road

      0  

    Default Unanswered: Panel with borderLayout fill it's parent body

    Unanswered: Panel with borderLayout fill it's parent body


    I want to add panel to one of tabs of tabPanel, I use border layout for panel but when i add panel to tab it can't fill it's parent body.
    panel code:
    Code:
    var viewport = Ext.create('Ext.panel.Panel', {    layout: {
        type: 'border',
        padding: 5
        },
    defaults: {
        split: true,
        anchor:'100%'
        },
    id:'viewPort',
    width:1200,
    height:750,
    items: [{
        region: 'west',
        collapsible: true,
        title: 'Starts at width 30%',
        split: true,
        width: '17%',
        minWidth: 100,
        minHeight: 140,
        layout:{
        type:'vbox',
        align:'stretch'
        },
    items: [show,treePanel,propGrid]
    },tabs]
    });

    tab code that is parent of panel and when user click on it panel loaded to it dynamically:
    Code:
    var mainTabs = Ext.create('Ext.tab.Panel', {    layout: 'anchor',
        id:'mtabs',
        defaults: {
        split: true,
        anchor: '100%'
        },
    items: [{
        title: 'Layout Window',
        closeAction: 'hide',
        layout: {
        type: 'border',
        padding: 5
        },
    //anchor: '100%',
    width:600,
    height:600,
    listeners: {
        activate:function (tab) {
    
    
        }
    },
    items: [{
        region: 'west',
        collapsible: true,
        title: 'Starts at width 30%',
        split: true,
        width: '17%',
        minWidth: 100,
        minHeight: 140,
        layout:'vbox',
        items: [historyTreePanel,propGrid]
        },tabs]
    },{
        title: 'History',
        //xtype:'panel',
        /*width:2000,
        height:1024,*/
        html: 'Please Wait...',
        id:'history-tab',
        layout:'fit',
        layout: 'hbox',
         default: {
         anchor:'100%'
         },
    //iconCls: 'favorites',
    //cls: 'card1',
    listeners: {
        activate:function (tab) {
        if(!flag){
        flag = true;
            $.getScript("/FleetManagement/js/history/fleethistory.js", function(data, textStatus, jqxhr) {
                var historyTab = Ext.getCmp('history-tab');
                historyTab.add(viewport);
                historyTab.doLayout();
            });
    }
    }
    }
    }],
    renderTo : Ext.getBody()
    });
    });

    in the above code tab with id:'history-tab' is my mentioned tab.How can i fix this problem?
    Untitled.jpg

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,677
    Answers
    3355
    Vote Rating
    749
    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'm seeing a few things wrong.

    I'm assuming the mainTabs tab panel is the tabs variable in the viewport? If it is then the mainTabs should not have renderTo config.

    Also you shouldn't change the layout of a tab panel.
    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.

Thread Participants: 1

Tags for this Thread

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