PDA

View Full Version : [CLOSED] Grid columns autoDestroy not respected



mankz
6 Jun 2014, 8:41 AM
Reported in Ext 4 and marked as fixed, but still Open.

https://fiddle.sencha.com/#fiddle/6ei

evant
6 Jun 2014, 9:35 PM
The autoDestroy behaviour is for removal of items. When you destroy a hierarchy, everything goes with it. This is the same for containers/components across the board.



Ext.onReady(function() {

var ct = new Ext.container.Container({
renderTo: document.body,
autoDestroy: false,
items: [{
xtype: 'component',
listeners: {
destroy: function() {
console.log('go1');
}
}
}, {
xtype: 'component',
listeners: {
destroy: function() {
console.log('go2');
}
}
}]
});
ct.remove(0);
ct.destroy();

});

mankz
7 Jun 2014, 11:58 AM
This is problematic if you're doing a grid reconfigure, and you want to keep one of the existing grid columns. Won't it be destroyed and recreated?

evant
7 Jun 2014, 10:51 PM
It would be, yes. Perhaps the docs can be made clearer, but it's fairly atypical to want to hold onto a reference to a column in such a way.