Umit
Umit

Reputation: 323

Extjs beautiful synchronous Popup

Is there a beautiful synchron Popup in extjs, to replace the standard Popup(alert("xyz")) ?

Upvotes: 2

Views: 18865

Answers (4)

BhandariS
BhandariS

Reputation: 604

{
    xtype: 'button',
    text: 'alert',
    id: 'alert',
    width: 120,
    margin: '70 0 4 10',
    disabled: true,
    handler: function() {
        Ext.MessageBox.alert('Alert', 'xyz');
    }
}

This is a message box which looks much better than the general alert, you can also use confirm() in place of Ext.MessageBox.alert

like:

Ext.MessageBox.confirm('Confirm', 'xyz' , function(btn){
    if(btn === 'yes'){
        //`enter code here`
    }
});

Upvotes: 0

Yellen
Yellen

Reputation: 1780

You should definitely take a look at Ext.window.Toast

Ext.toast('Ola!! Me Toast..');

Here, try this fiddle - https://fiddle.sencha.com/#fiddle/lhk

It has more aesthetics than Alert.

Upvotes: 0

bobince
bobince

Reputation: 536329

Do you really mean ‘synchronous’, or are you just using it to mean the kind of in-page pop-up element that is sometimes (misleadingly) called ‘modal’?

Because if you really need truly synchronous dialogue boxes, that return a result in the same thread of execution they were called, you only have:

  • the built-in alert() and confirm() boxes;
  • a seperate showModalDialog() window (IE extension, to be standardised by HTML5)

These are both generally undesirable because, being synchronous, they hang up the whole user interface in most browsers. showModalDialog is usually considered especially offensive.

You should replace them with asynchronous dialogue boxes that return results via a callback (such as the message-boxes linked by Erik), wherever possible.

Upvotes: 10

Erik
Erik

Reputation: 20712

http://www.extjs.com/deploy/dev/examples/message-box/msg-box.html

I don't know about beautiful, but thats extjs's modal dialog.

Upvotes: 6

Related Questions