ExtJs 常用方法(alert confirm prompt show wait)

1、alert方法

        // 提示框
	Ext.MessageBox.alert("提示信息","hello world!!!");
	Ext.Msg.alert('ExtJs');
	alert('执行');
	
注:执行到ExtJs中的alert方法不会停止运行。不同于原生的js alert方法

2、confirm方法

<span style="white-space:pre">	</span>//询问框
	Ext.Msg.confirm('提示信息','确认要删除这条信息吗?',function(op){
		if(op == 'yes'){
			alert("确认删除");
		}else{
			alert("取消了");
		}
	})

3、prompt方法
<span style="white-space:pre">	</span>//输入框
	Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
	    if (btn == 'ok'){
	        // process text value and close...
	    	alert('ok');
	    }
	    console.info(btn); // 按钮
	    console.info(text); //输入框内容

	});
4、show方法
//自定义提示信息
	Ext.Msg.show({
	     title:'Save Changes?',
	     msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
	     buttons: Ext.Msg.YESNOCANCEL,  //显示的btn    
	     icon: Ext.Msg.QUESTION//图标 4种  INFO QUESTION ERROR WARNING

	});
5、wait方法

//等待框1
	/*var p = Ext.create('Ext.ProgressBar', {
	   renderTo: Ext.getBody(),
	   width: 300
	});
	// Wait for 5 seconds, then update the status el (progress bar will auto-reset)
	p.wait({
	    interval: 500, //bar will move fast!
	    duration: 50000,
	    increment: 15,
	    text: 'Updating...',
	    scope: this,
	    fn: function(){
	        p.updateText('Done!');
	    }
	});*/
	//等待框2
	Ext.Msg.wait('提示信息','我是内容',{
	interval: 500, 			//循环定时的间隔
	    duration: 10000,		//总时长
	    increment: 5,			//走完一次进度条次数
	    text: 'Updating...',	//进度条上的文字
	    scope: this,			//作用范围
	    fn: function(){			//回调函数
	        alert('更新成功!!!');
	    }
	})



--------------------------------



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值