-
12 Nov 2006 12:24 AM #1Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
LayoutRegion.hasPanel
LayoutRegion.hasPanel
Bug when you pass a panel object in, it's passing in the panel object itself into the MixedCollection "get" function (i.e. this.panels.get(id)) instead of its id (i.e. this.panels.get(panel.getId()) )...yes the parameter name is "id" for hasPanel, but I thought it was unintuitive to have to use the panel ID rather than the panel itself...so this isn't really a bug I guess. Bah, whatever :-)
-
12 Nov 2006 4:59 AM #2
This is what I have:
And:Code:hasPanel : function(panel){ return this.getPanel(panel) ? true : false; }
So if you pass in a panel object it should typeof to 'object' and return true. Is that the same code you have?Code:getPanel : function(id){ if(typeof id == 'object'){ // must be panel obj return id; } return this.panels.get(id); }
-
12 Nov 2006 9:00 AM #3Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
it sure is....but the problem is if the panel is closed/removed from a region and you're testing that region to see if the panel is still showing by using hasPanel, you get a false-positive.
If there's another method I should use besides iterating through this.panels.items manually, let me know.
-
12 Nov 2006 6:59 PM #4
Good point. I will correct that.
-
12 Nov 2006 7:00 PM #5
Code:hasPanel : function(panel){ if(typeof panel == 'object'){ // must be panel obj panel = panel.getId(); } return this.getPanel(panel) ? true : false; }
-
13 Nov 2006 5:40 AM #6Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
Cool.
Similar Threads
-
LayoutRegion and LayoutStateManager
By stekolla in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 21 Mar 2007, 12:45 AM -
grid from tabpanelitem (in layoutregion)
By seldon in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 8 Feb 2007, 5:09 AM -
Creating a custom LayoutRegion?
By dlibby00 in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 6 Feb 2007, 12:08 PM -
Problem with LayoutRegion.setActivePanel ??
By tryanDLS in forum Ext 1.x: BugsReplies: 6Last Post: 15 Nov 2006, 9:15 PM


Reply With Quote