PDA

View Full Version : Possible Bug in Sencha Form Panel



m4manas
16 Jan 2012, 8:53 PM
I m trying to create a component by extending Sencha FormPanel and then set these panels as xtype in a panel with card layout. I find when i switch card the first card content are retained in case the second card content are small it is displayed on top of this.
The example code i have shown below.

After much hit and trial i found if i remove the listerens it works well else it does not. Any idea ??



Express.views.UserContact = Ext.extend(Ext.form.FormPanel, {
initComponent: function() {
Ext.apply(this, {
items: [
{
html: '<div><p><strong>Please provide your location address</p></div>'
} ],

listeners: {
beforeactivate: function() {
var continueButton = this.down('#userLoginContinueButton'),
model = this.getRecord();
},
deactivate: function() {
this.resetForm();
}
}
});


Express.views.UserContact.superclass.initComponent.call(this);
},
});

mitchellsimoens
16 Jan 2012, 9:16 PM
You use on() to add listeners when using Ext.extend:


initComponent() {
ClassName.superclass.initComponent.call(this);

this.on('beforeactivate', function() {}, this);
}

m4manas
16 Jan 2012, 9:44 PM
Thanks mitchellsimoens,
This has indeed taken a long time for me to figure out.