REQUIRED INFORMATION


Ext version tested:
  • Ext 4.0.2a

Browser versions tested against:
  • Google Chrome 12.0.742.122
  • FireFox 5.0.1 (Firebug 1.7.3)

Description:
  • If we attach a listener to checkbox' change event that would destroy the checkbox, we will get a DOM error.

Steps to reproduce the problem:
  • Open the test case
  • Click on the checkbox

The result that was expected:
  • Checkbox disappears quietly

The result that occurs instead:
  • Checkbox disappears producing a DOM error

Test Case:

Code:
Ext.onReady(function(){
    Ext.create('Ext.form.field.Checkbox', {
        renderTo: Ext.getBody(),
        listeners: {
            'change': function(box) {
                box.destroy();
            }
        }
    });
});
HELPFUL INFORMATION

Operating System:
  • Mac OS X 10.6.8

The purpose:
  • I tried to make a radio button control that would change a working mode of my application. When the radio state/value is changed, the application interface needs to be destroyed and created again.


Workaround found:

Code:
Ext.Function.defer(box.destroy, 3, box);