1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    20
    Vote Rating
    1
    Shadin_a is on a distinguished road

      0  

    Default Auto width and bottom toolbar

    Auto width and bottom toolbar


    I am working on Extjs 4 app consists of container contains many panels with different layouts and one bottom toolbar (dock: bottom).

    In order to tailor container design to various screen sizes, I am supposed to set container width to auto. but when I do that, the toolbar becomes almost Hidden!!
    it shows when i set it to top but disappears when reset it to bottom.

    What am I missing here ?

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


    Please show your code of your setup ...

    example that should work:

    Code:
    Ext.define('MyApp.view.MyPanel', {
        extend: 'Ext.panel.Panel',
    
        height: 200,
        width: 400,
        title: 'My Panel',
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                dockedItems: [
                    {
                        xtype: 'toolbar',
                        dock: 'top'
                    }
                ]
            });
    
            me.callParent(arguments);
        }
    
    });
    Scott.

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,365
    Vote Rating
    135
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Just a thought (but, yes, a code example is essential for correct answers)...

    Docked items do not participate in shrink-wrapping which is, I believe,the form of auto-sizing you are wanting.

    If you want a bottom toolbar that does participate in the shrink-wrap width of a panel you might need something like this:

    PHP Code:
    Ext.require('*');

    Ext.onReady(function() {
        new 
    Ext.Panel({
            
    shrinkWraptrue,
            
    layout'vbox',
            
    renderToExt.getBody(),
            
    items: [{
                
    xtype'component',
                
    html'Hello',
                
    flex1
            
    },{
                
    xtype'toolbar',
                
    items: [
                    { 
    xtype'button'text'Button 1' },
                    { 
    xtype'button'text'Button 2' }
                ]
            }]
        });
    }); 
    Depending on the container such a panel is placed in, the shrinkWrap flag may not be needed (e.g., in some layouts like an absolute, box or border layout, child items are shrinkWrap in all cases).
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

Thread Participants: 2

Tags for this Thread