-
3 Dec 2012 8:24 AM #1
Help to diagnose problem on 'prepareItems' of AbstractContainer
Help to diagnose problem on 'prepareItems' of AbstractContainer
Hi all,
I'm trying to diagnose a problem and I'm certain it's a timing issue. Sometimes it's happens and sometimes it's not.
Basically I have a component that sits on TabPanel that is not visible yet. The initComponent method creates a new Toolbar with items and separators and several other components.
And then, sometimes, I get a problem on 'prepareItems' of AbstractContainer:
The 'item' that is being lookep up is '-' (a separator from the Toolbar). It appears that sometimes this item does not exist yet... and when it tries to clean the container during the initialization it gives an 'undefined' error. Is there a background process that creates this type of standard components ? How to guarantee that a separator is being created when adding a new component ?PHP Code:item.isContained = me;
items[i] = me.lookupComponent(item);
delete item.isContained;
---> delete items[i].isContained;
Unfortunately I could not isolated a minimum case to post. I'm sorry. But I was wondering if somebody has seen something similar and what can I do to debug, diagnose, etc.
tks
R.
-
5 Dec 2012 11:43 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
When you have the issue is it under a tab that hasn't been made active yet?
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.
-
5 Dec 2012 12:14 PM #3
Yes. I have a controller and on the "init: function() { ..." I have something like:
I use 'defer' because there are a lot of tabs.PHP Code:
Ext.Function.defer(function() {
this.getMyTab().add(
{
xtype: 'mycomponent',
region: 'center',
title: 'Comp',
itemId: 'tabcomp',
closable : false,
tabConfig: { tooltip: 'My tip...' }
});
}, 500, this);
The error I mentioned happened on a Toolbar that it's created on 'mycomponent'.
tks
RW
-
5 Dec 2012 12:20 PM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
By default the tab panel will not render items that have not yet been activated yet.
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.
-
5 Dec 2012 12:26 PM #5
I know. As I said previously, it works 99% of the time. Once in a while it fails. All this happens on the init event and none of the components have been rendered yet.
-
5 Dec 2012 3:13 PM #6
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
5 Dec 2012 3:56 PM #7
Good point. I can't say. Since this seems fixed on the next version and I'm using Chrome 23, I'll keep an eye on version 24 and see if they will merge it.
tks!
-
5 Dec 2012 4:03 PM #8
In the interim you can change Toolbar:
Code:lookupComponent: function(c) { var args = arguments; if (typeof c == 'string') { var T = Ext.toolbar.Toolbar, shortcut = T.shortcutsHV[this.vertical ? 1 : 0][c] || T.shortcuts[c]; if (typeof shortcut == 'string') { c = { xtype: shortcut }; } else if (shortcut) { c = Ext.apply({}, shortcut); } else { c = { xtype: 'tbtext', text: c }; } this.applyDefaults(c); // See: EXTJSIV-7578 args = [c]; } return this.callParent(args); }Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
5 Dec 2012 4:41 PM #9
Awesome! EXTJSIV-7578 looks to be exactly the problem I'm facing!
Applying the patch right now...


Reply With Quote