PDA

View Full Version : Triggers from TwinTriggerField don't disappear on remove



ssayen
29 Aug 2012, 6:01 AM
Hello,

when I remove a home made field extended from TwinTriggerField from a container, his triggers stay there.
I saw there is a fix for the TwinTriggerField destroy event, but my field isn't destroyed as I need it elsewhere.

Is there any way to fix that ?

Thanks ;)
Laurent

ssayen
31 Aug 2012, 6:28 AM
I'm still having this issue. Any idea please ?

scottmartin
5 Sep 2012, 3:01 PM
Please create a small example of what you are trying to do so we can have a look.

Scott.

ssayen
9 Sep 2012, 11:27 PM
[Sorry I thought I posted that days ago, but obviously it didn't work : thanks, autosave ! ;)]

Hey Scott,

sure, here is a simple example in a factory function, 2 twintriggers with a button which removes (but doesn't destroy) the second one.
You will see that most of the field remains visible. But if you destroy it (myForm.get(1), true), it disappears correctly.



function testForm(options) { var myForm = new Ext.form.FormPanel({
items: [
new Ext.form.TwinTriggerField({
fieldLabel: 'text champ 1'
})
,new Ext.form.TwinTriggerField({
fieldLabel: 'text champ 2'
})
]
,buttons: [
new Ext.Button({
text: 'supprimer un bouton'
,handler: function() {
myForm.remove(myForm.get(1), false);
}
})
]
});
return myForm;
}