PDA

View Full Version : How can I set waitMsgTarget to window



AndreKR
4 May 2010, 4:23 PM
Hi,

I have a window to edit a grid row:


rowdblclick: function(g, rowIndex, e) {
var fenster = new Ext.Window({
initHidden: false,
items: {
xtype: 'form',
itemId: 'detail_form',
waitMsgTarget: true,
Because I agree with this (http://www.extjs.com/forum/showthread.php?13413-Form-and-WaitMsgTarget) guy, I want the waitMsgTarget to be the window. However, I cannot give the window an id because that will break when the second window (for another row) is created (and, by the way, an id enables the stateful functionality).

So how can I accomplish the desired effect without specifying an id? (Possibly by somehow interfering with the Action object?)

Regards,
André

darthwes
4 May 2010, 5:16 PM
Try to post code that we can copy-paste and start to look at the problem dead on instead of a snippet. I'm not going to do work for you. It takes some work to get an answer from the forums.

AndreKR
4 May 2010, 5:42 PM
Of course I will. Just thought it would be easier to read 7 lines than it is with 51 lines.

I set up a testcase (http://kundenweb.creations.de/usenet/ext_layout/ext_sandbox.htm) where you can see the window in action.

By the way, can I automatically have the window just as high as needed to hold the form?

darthwes
4 May 2010, 7:58 PM
{
text: 'Save', handler: function(b,e) {
this.ownerCt.ownerCt.getForm().waitMsgTarget = fenster.id;
this.ownerCt.ownerCt.getForm().submit({
url: 'sleep.php',
waitMsg: 'Saving...'
});
}
}

If you drop the width and height on the window it will auto-size (layout:'fit'), i think (not tested).

Hope this helps.

AndreKR
6 May 2010, 9:17 AM
If you drop the width and height on the window it will auto-size (layout:'fit'), i think (not tested).


Unfortunately not, it then has a height of 0.