Results 1 to 3 of 3

Thread: How to set "stretch" align for dockedItems?

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Taiwan
    Posts
    106
    Answers
    1

    Default Answered: How to set "stretch" align for dockedItems?

    Code:
    Ext.define('myPanel', {
        extend : 'Ext.panel.Panel',
        dockedItems: [{
            xtype: 'toolbar',
            dock: 'top',
            items: [{
                layout: {       
                    align: 'stretch' // doesn't work?
                },
                xtype: 'textfield',     
                value: 'Type something'            
            }]
        }]
    });
    why doesn't textfield stretch in this example?

  2. I think this is what you're after, where I embedded your panel config in a Window for ease of testing:

    Code:
    Ext.create('Ext.window.Window', {
      height: 400,
      width: 400,
      items: [{
        xtype: 'panel',
        dockedItems: [{
          xtype: 'toolbar',
          dock: 'top',
          items: [{
            xtype: 'textfield',     
            flex: 1,
            value: 'Type something'   
          }]
        }]
      }]
    }).show();

  3. #2
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Answers
    11

    Default

    Hi! You are place layout in wrong place.
    PHP Code:
     Ext.define('myPanel', {     
      
    extend 'Ext.panel.Panel',     
      
    dockedItems: [{        
        
    xtype'toolbar',         
        
    dock'top',
        
    layout'fit',//  work?         
        
    items: [{             
          
    xtype'textfield',                  
          
    value'Type something'                     
        
    }]
      }]
    }); 

  4. #3
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    I think this is what you're after, where I embedded your panel config in a Window for ease of testing:

    Code:
    Ext.create('Ext.window.Window', {
      height: 400,
      width: 400,
      items: [{
        xtype: 'panel',
        dockedItems: [{
          xtype: 'toolbar',
          dock: 'top',
          items: [{
            xtype: 'textfield',     
            flex: 1,
            value: 'Type something'   
          }]
        }]
      }]
    }).show();
    Last edited by friend; 23 Jul 2012 at 4:01 AM. Reason: formatting

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •