-
14 Mar 2013 8:53 AM #1
[2.2.0 Beta] Ext.field.Select does not destroy its list panel (picker)
[2.2.0 Beta] Ext.field.Select does not destroy its list panel (picker)
I noticed a growing number of items inside my Ext.Viewport whenever i used a 'selectfield' with the list picker (usePicker: false). As recommended i destroy all panels that i don't use anymore in my Ext.Viewport. Here i noticed that the number is growing after calling a form with a selectfield in it, even if the form panel is destroyed.
I solved it by adding the following lines inside the destroy() method of Ext.field.Select:
MichaelCode:... if (this.listPanel) { Ext.destroy(this.listPanel); } if (this.picker) { Ext.destroy(this.picker); } ...
Code:Ext.Viewport.add({ items : [ { html : 'Open picker on select field first, then tap button. Console should show undefined.' }, { xtype : 'selectfield', label : 'Test', options : [ { text : 'First Option', value : 'first' }, { text : 'Second Option', value : 'second' }, { text : 'Third Option', value : 'third' } ], defaultTabletPickerConfig : { id : 'myselectfieldlist' } }, { xtype : 'button', text : 'Destroy Select Field', handler : function() { var field = Ext.Viewport.down('selectfield'), cmp; field.destroy(); cmp = Ext.getCmp('myselectfieldlist'); console.log(cmp); //should be undefined } } ] });Last edited by mitchellsimoens; 14 Mar 2013 at 9:41 AM. Reason: Added test
-
14 Mar 2013 9:41 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
Thanks for the report! I have opened a bug in our bug tracker.
-
14 Mar 2013 10:08 AM #3
Thanks for the test case. This is true for both, the tablet picker and the phone picker.
Michael
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-4130
in
Sprint 31.


Reply With Quote