1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    162
    Vote Rating
    2
    rafaelrp is on a distinguished road

      0  

    Default Problem with panel witdh on Fit layout

    Problem with panel witdh on Fit layout


    Hello!

    I have a border layout with a Tab Panel in the center container and i've created a panel inside a tab in tab panel but the panel does not resize the width if i collapse the left pannel for example.

    here is the code..
    Code:
    {
                id: 'contentTabs',
                region: 'center',
                layout: 'fit',
                xtype: 'tabpanel', // TabPanel itself has no title
                activeTab: 0,
                items: {
                    title: 'Test',
                    html: 'Teste',
                    layout: 'fit'
                }
            }
    And here is the panel inside the tab
    Code:
    Ext.create('Ext.panel.Panel', {
        layout:'fit',
        items: {
            title: 'Fit Panel',
            html: 'Content',
            border: false
        },
        renderTo: 'usuarios-content'
    });

    Thanks !
    Last edited by rafaelrp; 22 Mar 2013 at 5:32 AM. Reason: wrong title

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,882
    Vote Rating
    440
    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

      1  

    Default


    You do not need a renderTo in child panel.

    How are you adding the panel as tab item?

    Scott.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    1
    Vote Rating
    0
    parameswara is on a distinguished road

      0  

    Default Please check the code snippet

    Please check the code snippet


    Code:
    { bodyStyle: 'border: none;',
    	   layout: {
                    type: 'border',
                    padding: 5
                },
                items: [{
    		            region: 'west',
    		            collapsible: true,
    		            width: 225,
    		            split: true,
    		            minWidth: 175,
    		            maxWidth: 400,
    					title: 'A Grid',
    					layout: 'fit',
    					items: [aGrid]
                },{
                	region: 'center',
                	xtype: 'tabpanel',
                	id: 'a1TabPanel',
                	layout: 'fit',
                	items:[{
                		bodyStyle: 'border: none;',
                		id: 'a1Tab',
    					layout: {
    		                type: 'border'
    		            },
    		            items: [{
    		            		region: 'north',
    					layout: 'fit',
    			            	height: 175,
    			            	split: true,
    			            	minHeight: 175,
    					columnLines : true,
    					items:[someXGrid]
    		            },{
    		            	region: 'center',
    		            	layout: {
    				                type: 'fit',
    				                padding: 0
    				        },
    		            	items:[someXPanel]
    		            }]
                	}]
                }]
            }
    Last edited by scottmartin; 22 Mar 2013 at 6:45 AM. Reason: Format your code

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    162
    Vote Rating
    2
    rafaelrp is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    You do not need a renderTo in child panel.

    How are you adding the panel as tab item?

    Scott.
    I have a loader on the tab calling another .php file with a create class to create the panel rendered in a div in the .php file..

    Thanks!

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    162
    Vote Rating
    2
    rafaelrp is on a distinguished road

      0  

    Default


    I have solved the problem by using the add method to add grids and toolbars.

    Code:
    Ext.getCmp('contentTabs').getActiveTab().add(gridUsuarios);
    Thanks!

Thread Participants: 2