Search code examples
extjsextjs4

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()
        });
    }
});

Solution

  • It works now...xtype should be image.

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