pmaisonn
2 Dec 2011, 8:06 AM
I've defined into Ext Designer a custom subclass of Panel, ClientAddPanel, that contains a form and a submit button which calls a saveClient method on click.
At application launch, I can corrreclty see into the console the initComponent method call.
The issue is when I try to instantiate a second time my subclass panel which is linked to a new tab, the initComponent method is not called so I'm loosing the default event handling for this subclass.
Where did I miss the bus ? :)
thanks for your support,
Here is the code for my subclass :
Ext.define('MyApp.view.ClientAddPanel', {
extend: 'MyApp.view.ui.ClientAddPanel',
alias: 'widget.clientaddpnl',
initComponent: function() {
console.log('ClientSearchPanel::initComponent: start');
this.callParent(arguments);
this.down('#savebtn').on('click', this.saveClient, this);
console.log('ClientSearchPanel::initComponent: done');
},
saveClient: function(button, event, options) {
console.log("ClientAddPanel::saveClient: start");
// some stuff here
console.log("ClientAddPanel::saveClient: form", form);
});
and the code that instantiate the second time my subclass :
var editctab = Ext.create('MyApp.view.ui.ClientAddPanel');
At application launch, I can corrreclty see into the console the initComponent method call.
The issue is when I try to instantiate a second time my subclass panel which is linked to a new tab, the initComponent method is not called so I'm loosing the default event handling for this subclass.
Where did I miss the bus ? :)
thanks for your support,
Here is the code for my subclass :
Ext.define('MyApp.view.ClientAddPanel', {
extend: 'MyApp.view.ui.ClientAddPanel',
alias: 'widget.clientaddpnl',
initComponent: function() {
console.log('ClientSearchPanel::initComponent: start');
this.callParent(arguments);
this.down('#savebtn').on('click', this.saveClient, this);
console.log('ClientSearchPanel::initComponent: done');
},
saveClient: function(button, event, options) {
console.log("ClientAddPanel::saveClient: start");
// some stuff here
console.log("ClientAddPanel::saveClient: form", form);
});
and the code that instantiate the second time my subclass :
var editctab = Ext.create('MyApp.view.ui.ClientAddPanel');