ExtJS的MessageBox总结

自己写了个ExtJS的MsgBox的小模版,以后遇到需要使用提示的地方就拿过来改改,免得每次都重新写。

 1       /**MsgBox start**/
 2           Ext.Msg.buttonText.yes = "是";
 3           Ext.Msg.buttonText.no = "否";
 4           Ext.Msg.buttonText.cancel = "退出";
 5           Ext.Msg.buttonText.ok = "确定";
 6          var errorTitle = "错误提示";
 7          var infoTitle = "信息提示";
 8          var questionTitle = "问确定提示";
 9          var warningTitle = "警告提示";
10           Ext.Msg.show({
11               title: errorTitle, //errorTitle infoTitle questionTitle warningTitle
12               closable: false,
13               width: 300,
14               icon: Ext.MessageBox.ERROR, // ERROR INFO QUESTION WARNING
15               msg: "你确定要删除该用户吗?",
16               buttons: Ext.Msg.YESNO, // CANCEL OK OKCANCEL YESNO YESNOCANCEL
17               fn: function(btn) {
18                   if(btn == "yes" || btn == "ok") {
19                       alert(btn);
20                   } else if(btn == "no" || btn == "cancel"){
21                       alert(btn);
22                   }
23               }
24           });
25           /**MsgBox end**/

posted @ 2014-03-20 13:05  神一样的存在  阅读(441)  评论(0编辑  收藏  举报