EXTJS 学习总结(1) Ext.MessageBox

/Alert 
function alertShow() { 
    Ext.MessageBox.alert("Title", "msg", function(e) { 
        alert('alert : ' + e); //参数e,是点击的弹出框的按钮的值,ok,cancel.        
    }); 

 
  
 
//confirm 
function confirmShow() { 
    Ext.MessageBox.confirm("title", "msg", function(e) { 
        alert('confirm : ' + e); //参数e,是点击的弹出框的按钮的值,yes,no,cancel 
    }); 

 
  
 
//带文本框弹出的窗体 
function promptShow() { 
    Ext.MessageBox.prompt( 
        "title", 
        "msg", 
        function(e, text) { 
            alert(e + "-" + text); 
        }, 
        this, 
        true); 

 
  
 
//进度条显示的第一种方式 
function msgShow() { 
    Ext.MessageBox.show({ 
        animEl: 'aFrom', 
        buttons: Ext.Msg.YESNOCANCEL,  //弹出框按钮的设置Ext.Msg下有四种可选,设置为false则不显示任何按钮 
        closable: false,               //false,则不显示右上角的小叉 
        msg: 'MsxBox',                 //消息的内容 
        title: '标题', 
        fn: windowClose,               //关闭弹出框后执行的函数,如点击CHANCEL按钮退出时触发 
        icon: Ext.MessageBox.INFO,     //弹出框内容前面的图标,取值为Ext.MessageBox.INFO,ERROR, WARNING, QUESTION  
        width: '500', 
        prompt: true,                  //设为true,则弹出框带有输入框  
        multiline: true,               //设为true,则弹出框带有多行输入框 
        progress: true,                //设为true,显示进度条 
        progressText: '进度条',        //显示在进度条上的字 
        wait: true,                    //设为true,动态显示progress 
        waitConfig: {                  //配置参数,以控制显示progressexample 
            interval: 600,             //进度的频率 
            duration: 5000,            //执行进度的持续时间,超过这个时间后,interval失效,不再产生进度效果,但进度狂也不会消失 
            fn: function() {           //时间到后执行的函数  
                Ext.MessageBox.hide(); //让进度条消失  
            } 
        } 
    }); 

 
  
 
//进度条显示的第二种方式 
function createupdateProgress() { 
    Ext.MessageBox.show({ 
        animEl: 'aFrom', 
        buttons: Ext.Msg.YESNOCANCEL,  //弹出框按钮的设置Ext.Msg下有四种可选,设置为false则不显示任何按钮 
        closable: false,               //false,则不显示右上角的小叉 
        msg: 'MsxBox',                 //消息的内容 
        title: '标题', 
        fn: ShowMSG,                   //关闭弹出框后执行的函数 
        icon: Ext.MessageBox.INFO,     //弹出框内容前面的图标,取值为Ext.MessageBox.INFO,ERROR, WARNING, QUESTION 
        prompt: false,                 //设为true,则弹出框带有输入框  
        multiline: false,              //设为true,则弹出框带有多行输入框 
        progress: true                 //设为true,显示进度条        
    }); 
     
    var f = function(v) { 
        return function() { 
            if (v == 12) { 
                Ext.MessageBox.hide(); 
                alert("加载完成!");  
            } 
            else { 
                var i = v / 11; 
                Ext.MessageBox.updateProgress(i, Math.round(100 * i) + "% completed", i); 
            } 
        } 
    } 
     
     for (var i = 1; i < 13; i++) { 
         setTimeout(f(i), i * 500); //从点击时就开始计时,所以500*i表示每500ms就执行一次  
     } 

 
  
 
//用于绑定的方法 
function windowClose() { 
     window.open('', '_self', ''); //IE7以后版本中,关闭窗体时保证不弹出询问对话框 
     window.close(); 

 
  
 
//用于绑定的方法 
function ShowMSG() { 
    alert(123); 
 

你可能感兴趣的:(ext,F#)