ExtJs學習之MessAgeBox的使用

來源:互聯網
上載者:User

1、Ext.MessageBox.alert()

  調用格式:

  alert( String title, String msg, [Function fn], [Object scope] )

  參數說明:

  title:提示框的標題。

  msg:顯示的訊息內容。

  [Function fn]:(可選)回呼函數。

  [Object scope]:(可選)回呼函數的範圍。

ExtJS MessageBox alert支援HTML格式文本。

Ext.onReady(function () {            Ext.MessageBox.alert("提示", "Hello World !", function (id) { alert("單擊的按鈕是:" + id); });        });

2、Ext.MessageBox.confirm()

  調用格式:

  confirm( String title, String msg, [Function fn], [Object scope] )

Ext.onReady(function () {            Ext.MessageBox.confirm("提示", "請單擊我,做出選擇!", function (id) { alert("單擊的按鈕是:" + id); });        });

3、Ext.MessageBox.prompt()

  調用格式:

  confirm( String title, String msg, [Function fn], [Object scope], [Boolean/Number multiline], [String value] )
  參數說明:

  [Boolean/Number multiline]:設定為false將顯示一個單行文本域,設定為true將以預設高度顯示一個多行文本區。或者以像素為單位直接設定文本域的高度。預設為false。

 Ext.onReady(function () {            Ext.MessageBox.prompt("提示", "請輸入內容:", function (id, msg) { alert("單擊的按鈕ID是:" + id + "\n" +"輸入的內容是:" + msg); }, this, true, "我是預設值");        });


4、Ext.MessageBox.show()

Ext.onReady(function () {            Ext.MessageBox.show({                title: "提示",                msg: "三個按鈕、一個多行文本域",                modal: true,                prompt: true,                value: "請輸入",                fn: function (id, msg) {                    Ext.MessageBox.alert("單擊的按鈕id是:" + id + "\n" + "輸入的內容是:" + msg);                },                buttons: Ext.Msg.YESNOCANCEL,                icon: Ext.Msg.QUEATION            });        });




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.