Alexander
Alexander

Reputation: 20224

Messagebox and Loadmask

I am showing an alert messagebox:

Ext.Msg.alert("Timezone difference","Please keep in mind that data is displayed server time zone, which differs by "+mins+" minutes from your local time.");

and in the background, I am loading data using a loadmask:

mystore.on('beforeload',function() {
    Ext.MessageBox.show({
        msg: "Loading data",
        width:300,
        wait:true,
        waitConfig:25
    });
});

Problem is that the messagebox is closed when the loadmask is opened.

I found no config option to keep it open. Is it possible?

Upvotes: 0

Views: 382

Answers (2)

jansepke
jansepke

Reputation: 1979

The right way to show a loading mask is to use mask() like:

Ext.getBody().mask('Loading data');

and after loading:

Ext.getBody().unmask();

Then you wont have duplicated Messageboxes

Upvotes: 1

V G
V G

Reputation: 19002

Ext.Msg is a shortcut for Ext.window.MessageBox, which is a SINGLETON, meaning there is a single instance of that. This means, you can display with it a single message simultaneously. In order to solve your problem you could:

  1. Create your own instances of Ext.window.MessageBox
  2. Use another way of displaying your messages (like rendering some text to a component).

Upvotes: 1

Related Questions