extjs - Add icon to a panel in Sencha -
i new sencha. trying add icon panel, code doesn't work.
ext.define('components.imagepanel', { extend: 'ext.panel', initialize: function () { this.callparent(arguments); var image = { xtype: "image", src: 'icon.png', width:100, height:100 }, scope: }; this.add([image]); }); what doing wrong?
wow, didn't know there image xtype.
anyway...
to use xtype, need create using ext.widget();
so code should this:
ext.define('components.imagepanel', { extend: 'ext.panel', initialize: function () { this.callparent(arguments); var image = ext.widget('image',{ xtype: "image", src: 'icon.png', width:100, height:100 }); this.add([image]); }; });
Comments
Post a Comment