masm
16 Jan 2012, 5:46 AM
For instance I have following base class:
Ext.define('MyCompany.BaseClass', {
extend: 'Ext.panel.Panel',
// This field I want to initialize
customField: '',
initComponent: function() {
this.callParent(arguments);
}
});
And custom derived class:
Ext.define('MyCompany.SubClass', {
extend: 'MyCompany.BaseClass',
initComponent: function() {
this.callParent(arguments);
}
});
And then I try to create an instance of subclass with passing a parameter to initialize 'customField':
Ext.create('MyCompany.SubClass', {
customField: 'Test'
});
Where is appropriate place to catch passed parameter in the class hierarchy and initialize necessary field?
Ext.define('MyCompany.BaseClass', {
extend: 'Ext.panel.Panel',
// This field I want to initialize
customField: '',
initComponent: function() {
this.callParent(arguments);
}
});
And custom derived class:
Ext.define('MyCompany.SubClass', {
extend: 'MyCompany.BaseClass',
initComponent: function() {
this.callParent(arguments);
}
});
And then I try to create an instance of subclass with passing a parameter to initialize 'customField':
Ext.create('MyCompany.SubClass', {
customField: 'Test'
});
Where is appropriate place to catch passed parameter in the class hierarchy and initialize necessary field?