PDA

View Full Version : Change window location



choncona1
14 Sep 2010, 11:13 PM
Hi everyone,
I am a starter of EXT. I have a code which create a Ext.window inside.
Something as shown below

Ext.getCmp('tempField').add(new Ext.Window({
id:'edit',
width:650,
height:550,
items:[{
.....
}]
}));
right now, when I want to refresh the "edit" window by using the code

window.location.reload()
it will reload the whole page.
Is there any way to change the window location to the "edit" window.
I really appreciate for your help.
Thanks

StuartAshworth
15 Sep 2010, 2:49 AM
You will need to use an Ajax request (or just reload the Store if you are using a grid) to refresh the contents of the Ext Window.

How are you loading data into the window originally? What components are within the items collection?

griffiti93
15 Sep 2010, 6:07 AM
Grab reference to your Ext window. Next, grab a reference to it's Update object. The call the update() method.



var window = Ext.getCmp('edit');
var updater = window.getUpdater();

updater.update({url: 'somepage.html'});


References:
Ext.Window (http://dev.sencha.com/deploy/dev/docs/?class=Ext.Window)
Ext.Updater (http://dev.sencha.com/deploy/dev/docs/?class=Ext.Updater)

choncona1
16 Sep 2010, 6:41 PM
hi guys,
Thanks for your fast replies.
I have the problem with the store ordering which only refreshing a whole page will solve the problem.
Basically, I put a sortable-columns grid inside the Window.
Something like below

Ext.getCmp('tempField').add(new Ext.Window({
id:'edit',
width:650,
height:550,
items:[{
xtype:'grid',
id: 'display',
store: storeEG,
cm: colModel
}]
}));
Ext.getCmp('edit').show();
I need to reload that window in order for the grid regain the order given by the database.

Animal
16 Sep 2010, 9:17 PM
Uh!

Reload the Window??????

Reload the Store!

And how are you HOPING that the grid gets sized within that Window?

choncona1
17 Sep 2010, 1:53 AM
hi,
I have a resizing function

function resizing()
{
Ext.getCmp('mainForm').setWidth(Ext.getBody().getViewSize().width);
Ext.getCmp('mainForm').setHeight(Ext.getBody().getViewSize().height);
Ext.getCmp('display').setWidth(Ext.getBody().getViewSize().width-50);
Ext.getCmp('display').setHeight(Ext.getBody().getViewSize().height-200);
}

like that the grid will fit into that window.It is like pop-up actually. And I just want to refresh that pop-up window

steffenk
17 Sep 2010, 1:57 AM
uh - unnecessary. Use a layout!

choncona1
17 Sep 2010, 2:09 AM
hi guys,
thank you very much for paying your time for a starter
I am solving a requirement from my senior which I need to do something like that
If there is a solution on how to change the window location, please let me know :)

Animal
17 Sep 2010, 2:41 AM
You have been told the answer to all your questions in this thread.

You just need to read the answers.