PDA

View Full Version : wait messagebox to front



Drake
10 Sep 2010, 5:26 AM
Hi,
I have a simple application where I want to show an infinite waiting messagebox after clicking a button.


handler:function(){
waitingBox.show({
msg: 'Please wait ... loading result',
progressText: 'Loading...',
width:300,
wait:true,
waitConfig: {interval:200}
});}

While loading data into several stores, the messagebox should be still in front of all windows; and that's my actual problem!
I was playing a while with the zseeds and windowsMgr and whatever I found in the forum; but nothing obviously helped.
The stores are loaded with the autoLoad option and it seems that as soon as the store reloads, the messagebox shifts to the back and all other panels come to the front.

Does anyone have a good suggestion how to solve this?

Thanks in advance!

Condor
10 Sep 2010, 6:03 AM
What is waitingBox?

Ext.MessageBox is a singleton, you can't create instances from it!

Drake
10 Sep 2010, 6:23 AM
waitingBox was a messagebox .. I exchanged it (thanks):

handler:function(){
Ext.MessageBox.show({
msg: 'Please wait ... loading result',
progressText: 'Loading...',
width:300,
wait:true,
waitConfig: {interval:200}
});}
But still, how can I set the messagebox to the front all the time?

sideeque
10 Sep 2010, 10:37 AM
I hope you don't have any other code after messageBox. Can you try with adding below code just below the message box.


return false;

Condor
10 Sep 2010, 11:09 AM
MessageBox uses the default WindowMgr to determine the z-index.

Any windows that use the same manager and are shown after the messagebox will be on top of it.

The solution is simple: Create a different WindowGroup for your windows.

darthwes
10 Sep 2010, 11:12 AM
The horror! The horror! Read this now (http://www.sencha.com/forum/showthread.php?108190-Changing-the-zindex-on-a-window-and-or-MessageBox.confirm-dialog....&p=506891#post506891)!

Condor
10 Sep 2010, 11:16 AM
The horror! The horror!

Why? The only thing WindowGroup is missing is an 'Always on top' feature.

darthwes
10 Sep 2010, 11:23 AM
Because you have to create a new WindowGroup (where Ext should expose a singleton that is tied to all the windows by default).
Because you then have to assign the WindowGroup to each window you want it to manage.
Because I should be able to say window.bringToFront().
Because .show should always put it on the highest-order z-index.

That's why I hate the class. I'm sure it's beautiful and well thunk. I'm sure it works. But, omg, the horror of having to retrofit all my windows to use proper managers...

Condor
10 Sep 2010, 11:33 AM
Luckily, a redesign of the whole z-index system is planned for Ext 4.

Drake
10 Sep 2010, 9:26 PM
so what I have done now:


var win = new Ext.WindowGroup();
win.zseed=10000;
Ext.WindowMgr.zseed = 20000;
...
win.register(panel);

I created a new WindowGroup and registered each single panel. For the MessageBox I just changed the WindowMgr zseed value.

But this also didn't have any effect on my messagebox.
What I'm doing wrong?

Thanks

Condor
10 Sep 2010, 10:29 PM
I would configure the panel with manager:win instead of calling win.register(panel).

ps. 'win' is not really a good name. It isn't a window; it's a window manager.

Drake
11 Sep 2010, 12:34 AM
followed your advice .. but still no effect ... as soon as the store gets reloaded, the messagebox goes to the back ...

Drake
11 Sep 2010, 5:12 AM
I have to describe my problem in a new way:
I have several panels; some of them have a piechart as item, others have a gridpanel or whatever as item. I just observed that the messagebox goes only behind the piecharts ... but stays in front of the gridpanel.

What can I do against that? .. Thanks

Condor
11 Sep 2010, 6:57 AM
Try:

Ext.useShims = true;

Drake
11 Sep 2010, 7:09 AM
I just put it in the beginning of the function .. no effect, unfortunately

Condor
11 Sep 2010, 7:24 AM
It needs to go before Ext.onReady.

Drake
11 Sep 2010, 7:56 AM
hmmm .... didn't work really; but when I click on the messagebox and start moving it around it stays in front ... what does this mean now?