开发者

Extjs beautiful synchronous Popup

Is there a beautiful synchron Popup in extjs, to replace the standard Po开发者_Go百科pup(alert("xyz")) ?


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.


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

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


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.


{
    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`
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜