sencha-touchsencha-architectsencha-touch-2.1

How to place the image in right side inside of text field in sencha touch


Can anybody tell How to place the image in right side inside of text field in sencha touch


Solution

  • This can be done by combining text field with label with corresponding image, here is an example:

     Ext.define("myapp.view.Places", {
    extend: 'Ext.Container',
    xtype: 'places',     
    config: {    
        layout: 'hbox',
        items: [
            {
                xtype: 'textfield',
                label: 'location',
                labelWidth: '35%',                             
                flex: 4        
            },
            {
                xtype: 'label',
                html: '<span style="float:right; margin-right:10px;"><img height="32px"  src="image.jpg"/></span>',
                padding: '6 0 0 0',
                flex: 1        
            }        
        ]        
    }
    

    });