Alias
In the API, the explanation is: Alias class name short alias list. Most used to define Xtypes
1Ext.define (' Myapp.panel ', {2Extend: ' Ext.panel.Panel ',3Alias: ' Widget.mypanel ',4Title: ' Mypanel '5 });6 7Ext.onready (function(){8 //using Ext.create9Ext.create (' Widget.mypanel ',{TenHTML: ' Create widget! ', Onewidth:400, Aheight:200, -Brodertrue, - renderTo:Ext.getBody ()}); the - //using Xtype -Ext.widget (' Panel ', { - renderTo:Ext.getBody (), +width:400, -Margin: ' 10 0 0 10 ', +Brodertrue, A items: [ at{xtype: ' Mypanel ', HTML: ' xtype1! '}, -{xtype: ' Mypanel ', HTML: ' xtyoe2! '} - ] - }); - - in});
Effect:
However, in the 5.0 official example, I often see examples where alias is rarely used to denote class aliases, but often used xtype to denote
1Ext.define (' Myapp.panel ', {2Extend: ' Ext.panel.Panel ',3 //alias: [' Widget.mypanel '],4Xtype: ' Mypanel ',5Title: ' Mypanel '6 });7 8Ext.onready (function(){9 //using Ext.createTenExt.create (' Widget.mypanel ',{ OneHTML: ' Create widget! ', Awidth:400, -height:200, -Brodertrue, the renderTo:Ext.getBody ()}); - - //using Xtype -Ext.widget (' Panel ', { + renderTo:Ext.getBody (), -width:400, +Margin: ' 10 0 0 10 ', ABrodertrue, at items: [ -{xtype: ' Mypanel ', HTML: ' xtype1! '}, -{xtype: ' Mypanel ', HTML: ' xtyoe2! '} - ] - }); - in -});
The effect is the same, it feels better to remember than the original, more intuitive.
"ExtJS" about alias and Xtype