Results 1 to 3 of 3

Thread: A layout problem with textfield , panel and image

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
      0  

    Default Answered: A layout problem with textfield , panel and image

    Hi
    I have a textfield and an image , simply put them into another panel and try to let the image stay at the right side of the textfield (no breakline)

    Code:
    this.listpanel.addDocked({                
            xtype: 'toolbar',
            ui: 'gray',
            dock  : 'top',           
                    items: {
                        xtype: "panel",
                        items: [{                        
                                xtype : 'textfield',
                                flex  : 1,                    
                                listeners: {
                                    keyup: { fn: this.FillterFieldkeyDown, scope: this }                    
                                },
    
                            },{
                            xtype: "panel",
                            html: "<img src='/313/image/icon/magnifier.png'></img>",                                                  
                            }],                                                
                        }                
                });
    tried 'float :left' on the textfield and 'float:right' on the image , not work

    Untitled.png

    also tried both left on the textdfield and right on the image, its work but add some strange blank at top

    Untitled2.png

    ths
    Attached Images Attached Images

  2. The panel that wraps the textfield and image, give it hbox layout, give the textfield flex : 1 and the image a width.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    The panel that wraps the textfield and image, give it hbox layout, give the textfield flex : 1 and the image a width.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Ty mitchell . it works perfectly !!

Posting Permissions

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