Ext.ComponentManager
- Also provides a registry of all classes which extend from Component and their associated xtype
- By associating a class with an xtype we can defer its instantiation until it is needed
// After defining a class such as Ext.FormPanel
// it can be registered with an xtype
// Ext manages this for its own classes
// Ext.reg('form', Ext.FormPanel);
// Ext.reg('textfield', Ext.form.TextField);
// Example:
var a = new Ext.Window({
id: 'formWin',
width: 300,
height: 120,
layout: 'fit',
items: [{
xtype: 'form',
defaults: {anchor: '100%'},
items: [{
xtype: 'textfield',
fieldLabel: 'Username'
},{
xtype: 'textfield',
inputType: 'password',
fieldLabel: 'Password'
}]
}],
buttons: [{text: 'Login'}]
});
a.show();