Ext 学习(2)---ExtMessageBox
来源:互联网 发布:知乎的竞品 编辑:程序博客网 时间:2024/04/28 22:07
Ext 提示框
Ext.MessageBox经常用到的提示框有:alert confirm prompt progress,还有一个统一的处理方式 show
show方法常用的配置属性如下:
- 提示框的标题文字
- 提示框显示的文字
- 动画的目标对象,从哪里出来,在哪里消失
- 显示的按钮
- 是否显示关闭按钮
- 提示框中的显示的图标,有Question、info、error等
- 是否为输入框 true|false
- 是否显示为多行输入文本框
- 是否是进度条提示框progressText
- 进度款显示的文本
- 进度条宽度
- 事件处理函数
Ext.onReady(function(){//给Id是btn1的按钮绑定click事件Ext.get('btn1').on('click',function(e){Ext.MessageBox.confirm('Confirm','Are you sure to do that?',showResult);});Ext.get('btn2').on('click',function(e){Ext.MessageBox.prompt('prompt','Please enter you favorite food',showResultText,this,true);});//进度框Ext.get('btn4').on('click',function(e){Ext.MessageBox.show({ title: 'Please wait', msg: 'Loading items...', progressText: 'Initializing...', width:300, progress:true, closable:false, animateTarget: 'btn4'});var f = function(v){return function(){if(v == 12){Ext.MessageBox.hide();}else{var i = v/11;Ext.MessageBox.updateProgress(i, Math.round(100*i)+'% completed');} }; }; for(var i = 1; i < 13; i++){ setTimeout(f(i), i*500); }});Ext.get('btn3').on('click',function(e){Ext.MessageBox.show({animateTarget:'btn3',title:'Icon Alert Box',msg:'Is that beautiful?',prompt:true,multiline:true,buttons:Ext.MessageBox.YES,fn:showResultText,icon:Ext.get("icons").dom.value });});});function showResult(btn){ Ext.Msg.alert('Button Click', 'You clicked the '+btn+' button');}function showResultText(btn,text){ Ext.Msg.alert('Button Click', 'You clicked the '+btn+' button,And your enter is:' + text);}
- Ext 学习(2)---ExtMessageBox
- ext使用学习2
- Ext JS4.2学习笔记
- Ext 学习
- Ext学习
- 学习 ext
- ext学习
- 学习EXT
- ext学习
- Ext 学习
- EXT学习
- Ext学习
- ext 学习
- ext学习
- Ext 学习
- EXT学习
- Ext JS 学习(2) Ext.Panel 组件的使用
- Ext Js3.2中Ext.Element类的学习
- ABAP--如何暂停其他进程的处理,加速当前程序的处理速度
- linux sed命令详解
- Android中的Handle基础应用一
- MFC 获取picture控件的鼠标点击坐标位置的方法
- BCP导入其它服务器上的文件
- Ext 学习(2)---ExtMessageBox
- linux下的文本处理命令sed&awk&grep
- c++ 运算符重载
- PHP正则相关的几个preg函数
- sqlserver 以年月日为条件查询记录
- qq临时会话代码
- 学习HTML:iframe用法总结收藏
- delphi中关于字符串的操作
- 对于I2C总线协议的一些理解,未完待续。。。