简体   繁体   中英

Unable to load Image in ExtJS 4 form panel

I have a form panel..in which I am trying to add an image...the image block appears but the image is not getting loaded..resizing the image block works fine..Here is my code which I am calling from a html file.. Can someone help me with this??

 Ext.application({
    name : 'hello',
    launch : function() {
        Ext.create('Ext.form.Panel', {
            title : 'Create Catalog',
            defaultType : 'textfield',
            items : [ {
                fieldLabel : 'Name',
                name : 'name',
                anchor : '100%',
                allowBlank : false
            },{
                xtype : 'imagefield',
                fieldLabel : 'Image Here',
                src : 'i1.jpg',
                width : 50,
                height : 25
            }
            ],
                renderTo : Ext.getBody()
        });
    }
});

It works now...xtype should be image.

{
xtype: 'image',
fieldLabel: 'Image Here',
src: 'i2.png',
width: 50,
    height: 50
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM