Sorry, for the newcomer's stupid question, but I don't get what's the point in Ext.apply()?
If it just copies provided properties to the specified object, what's the difference between following two snippets?
Code:
Ext.define('MyApp.LoginWindow',{
extend:'Ext.Window',
title:'Log in',
initComponent:function(){
Ext.apply(this,{
items:[
{
xtype: 'textfield',
name : 'username',
fieldname: 'Username'
},
...
]});
}});
Code:
Ext.define('MyApp.LoginWindow',{
extend:'Ext.Window',
title:'Log in',
items : [
// as above
]
initComponent:function(){
...
}
});