javascript - what is this ext.js's "xtype: 'app-main'" -
newbie ext.js: trying understand this:
xtype: 'app-main'
means in auto generated code. no documentation available. guess reference me alias, not find it..
i used sencha cmd (latest may 2014 - ext.js 4.2.2) autogenerated number of files, had xtype: 'app-main' in them...
main.js
ext.define('test12.view.main', { extend: 'ext.container.container', requires:[ 'ext.tab.panel', 'ext.layout.container.border' ], xtype: 'app-main', <<<<------- layout: { type: 'border' }, items: [{ region: 'west', xtype: 'panel', title: 'west', width: 150 },{ region: 'center', xtype: 'tabpanel', items:[{ title: 'center tab 1' }] }] });
viewport.js
ext.define('test12.view.viewport', { extend: 'ext.container.viewport', requires:[ 'ext.layout.container.fit', 'test12.view.main' ], layout: { type: 'fit' }, items: [{ xtype: 'app-main' }] });
xtype config allow instantiate classes define more easily
example:
ext.define('myapp.view.mycoolpanel',{ extend : 'ext.panel.panel', xtype : 'coolpanel', //some cool configs ... }); //somewhere else ext.create('ext.window.window',{ //regular configs items: [ { xtype: 'coolpanel' } ] }).show();
see http://docs.sencha.com/extjs/4.2.2/#!/api/ext.panel.panel-cfg-xtype
best regards
Comments
Post a Comment