1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Dagolin is on a distinguished road

      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

  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
    38,391
    Vote Rating
    1095
    Answers
    3679
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    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
    Dagolin is on a distinguished road

      0  

    Default

    Ty mitchell . it works perfectly !!

Thread Participants: 1