带有自定义按钮的 ExtJs 消息框 [英] ExtJs Message box with Custom buttons

查看:21
本文介绍了带有自定义按钮的 ExtJs 消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用自定义按钮显示 ExtJS 消息框.

How to display ExtJS Message box with Custom buttons.

我想要一个带有自定义消息和取消"和停用"按钮的消息框.请给出一些想法.

I want a Message box with a Custom message and "Cancel" and "Deactivate" Buttons. Please give some idea.

buttons: [{
    text: "Cancel",
    handler: function () {
        Ext.MessageBox.hide();
        //submitTicketForm();
    }
},{
    text: "Deactivate",
    handler: function () {
        Ext.MessageBox.hide();
    }
}],

我像这样使用它但没有得到任何按钮.

I am using it like this but not getting any buttons.

推荐答案

MessageBox 是内部管理的 Window 的单个实例,用于提示、显示、警报等.

MessageBox is an single instance of an internally managed Window used for prompt, show, alert, etc.

您可以通过传入一个字符串来更改 buttonText 以进行显示,如下所示:

You can change the buttonText by passing in a string for show like this:

buttons: {ok: "Foo", cancel: "Bar"}

参考:MessageBox

buttons: { 
                ok: "Foo", 
                handler: function(){ 
                    Ext.MessageBox.hide(); 

                },
                cancel: "Bar",
                handler: function(){
                    Ext.MessageBox.hide();
                }
        }

这篇关于带有自定义按钮的 ExtJs 消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆