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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -