PDA

View Full Version : How to restrict Ext.getCmp to parent container?



dbassett74
18 Jun 2009, 11:03 PM
In traditional desktop application development, I was spoiled by the fact that you can have two separate windows that contain buttons that could have the same object ids as buttons in other windows and there is on conflict. But I guess in a web app, this is not the case.

What I'm running into is I am showing two (or more) copies of the same custom window that have some buttons defined. Within each window, I need to reference the buttons at certain times. So far, I have discovered the Ext.getCmp() method where I can pass in the button's id value. But the problem is, because I am displaying more than one copy of the same window, the Ext.getCmp() method sometimes grabs a button in a different window from where the code is actually running.

I would REALLY like to not have to make sure there are unique ideas across the whole app, in fact, I think this is nearly impossible since I am displaying the same window more than once. Is there some way to restrict Ext.getCmp() to the window that it is being executed in?

Animal
18 Jun 2009, 11:22 PM
http://extjs.com/deploy/ext-3.0-rc2/docs/?class=Ext.Component&member=ownerCt

http://extjs.com/deploy/ext-3.0-rc2/docs/?class=Ext.Container&member=items

http://extjs.com/deploy/ext-3.0-rc2/docs/?class=Ext.util.MixedCollection

dbassett74
22 Jun 2009, 8:38 AM
Using itemId along with Ext.GetComponent() worked perfectly. Thanks!