PDA

View Full Version : How to access parent window object



pra123@
15 May 2013, 8:09 AM
Hi all,

I have a window (Window 1)with one button.
On the button click action i am opening another window(Window 2).
When i will close the window 2 then i want to change the window 1 button text.

how i will access window 1 object while closing window 2?

please help how i will achieve this?

Thanks.

evant
15 May 2013, 7:10 PM
Are you using MVC? What does your code look like?

gameboy87
15 May 2013, 10:34 PM
In the Listener event of the window 2 close, add


Ext.getCmp('the-button-id').setText('your-text-here');

If the window 1 is configured in a object, try


windowObj.down('[name=button_name]').setText('your-text-here');

pra123@
16 May 2013, 7:21 AM
Hi, Thanks for your reply.

i got the solution.


var window1Obj = Ext.ComponentQuery.query('firstwindow')[0]; //where firstwindow is userAlias name of Window 1

window1Obj.down('#btn').setText('New text');


Using window1Obj, we can access any control of window 1.