-
7 Dec 2012 5:35 AM #1
ListItem doesn't destroy its header element
ListItem doesn't destroy its header element
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.1
- Chrome 23(Windows)
- Ext.List component consists of Ext.dataview.component.ListItem components.
- Every ListItem contains three elements: body, dislosure, header.
- When ListItem is created, it places body and dislosure in the items collection. But header is simply inserted in dom.
- When list is created with some data populated, then we have no any problems.
- But when list created empty, without data or store, then we have following problem:
- List subscribed on resize event.
- When resize is fired(it always fired, even if window size wasn't changed), the list, when it is empty, adds empty items.
- If after that we destroy list, the header items for every list item element are not destroyed.
- This also happens when, after creating empty, list was populated with data, and then destroyed. Those empty list items are not fully destroyed
- Create empty List
- Let resize event to be fired, wait some time
- Destroy List and check Ext.StoreManager.map, you will find there header components, which are not destroyed, although list is destoyed
- ListItem should destroy its header
- ListItem's header is not destroyed
Code:var list = Ext.create('Ext.List', { fullscreen: true, itemTpl: '{title}' }); setTimeout(function(){ list.destroy(); console.log(Ext.ComponentManager.map); // contains several ext-component, which are the listitem's header },1000);Last edited by mitchellsimoens; 7 Dec 2012 at 7:10 AM. Reason: fix test case
-
7 Dec 2012 7:04 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
The reason for the header is since the list supports infinite dataset, you never know which row will need to show a header. So as you scroll a header may need to be shown on any of the list items so they need to be there.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Dec 2012 7:06 AM #3
Yeap, i understand this. But this doesn't explain why headers are not destroyed. If they would be never destroyed , we will have a leak.
-
7 Dec 2012 7:10 AM #4
Mitchell, i mean the following. Lists in most cases will be created empty. And the headers created for empty list items elements, which i described above, will be never destroyed. In case we have many lists, or list is repeatedly created/destroyed, the memory will grow, this causes memory leak.
-
7 Dec 2012 7:11 AM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
I see the issue with your test case, you were looking at StoreManager not ComponentManager.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Dec 2012 7:16 AM #6
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3805
in
Sprint 28.


Reply With Quote