extjs4的Ext.Class的alias Config options

来源:互联网 发布:刘炳森手机字体软件 编辑:程序博客网 时间:2024/05/22 17:16

译自:http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.Class

alias : String[]

List of short aliases for class names. Most useful for defining xtypes for widgets:

Ext.define('MyApp.CoolPanel', {    extend: 'Ext.panel.Panel',    alias: ['widget.coolpanel'],    title: 'Yeah!'});// Using Ext.createExt.create('widget.coolpanel');// Using the shorthand for defining widgets by xtypeExt.widget('panel', {    items: [        {xtype: 'coolpanel', html: 'Foo'},        {xtype: 'coolpanel', html: 'Bar'}    ]});

Besides "widget" for xtype there are alias namespaces like "feature" for ftype and "plugin" for ptype.

Available since: 4.0.2


此处,

alias: ['widget.coolpanel'],
则可以通过以下方式访问(创建):

var panel = Ext.widget('coolpanel');

另外,widget为xtype而定义feature为ftype而定义;plugin为ptype而定义。







0 0
原创粉丝点击