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,326
    Answers
    3884
    Vote Rating
    1297
      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!

    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.

  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
  •