惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Heimdal Security Blog
S
Security @ Cisco Blogs
N
News | PayPal Newsroom
J
Java Code Geeks
罗磊的独立博客
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic
V
V2EX
WordPress大学
WordPress大学
Google Online Security Blog
Google Online Security Blog
N
News and Events Feed by Topic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
月光博客
月光博客
AI
AI
小众软件
小众软件
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
美团技术团队
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tailwind CSS Blog
S
Schneier on Security
博客园 - 三生石上(FineUI控件)
F
Full Disclosure
B
Blog RSS Feed
Forbes - Security
Forbes - Security
S
SegmentFault 最新的问题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
Cisco Talos Blog
Cisco Talos Blog
U
Unit 42
Project Zero
Project Zero
H
Hacker News: Front Page
Y
Y Combinator Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
S
Secure Thoughts
The Hacker News
The Hacker News
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - dail

IE浏览器在虚拟机中无法正常显示字符 jQuery在updatepanel中使用造成内存泄露 在使用jQuery的时候不小心的内存泄漏 jQuery 1.7的隐藏改动 在javascript中实现类似asp.net webcontrol中的render的方法 jQuery 1.6的变化 jQuery ui effects - dail jQuery ui 1.8.6 position 的一个bug 一个progressbar widget jQuery编写widget的一些窍门 jquery animate动画的特殊用法。 一个简单的widget Jquery ui widget中的_create(),_init(),destroy() Jquery ui widget开发 Jquery ui css framework jquery animate Json.net简单用法 EXTJS学习(一) jquery+linq制作博客(二)
EXTJS学习(二)Message
dail · 2008-03-29 · via 博客园 - dail

上一节 EXTJS学习(一)
上一节简单介绍了下EXTJS,接下来学习其中的消息类
这里面有以下几个方法
1.Alert
alertString title, String msg, [Function fn], [Object scope] ) : 
这里面后面两个参数是非必须的,以下是例子
 Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);
 function showResult(btn){
        Ext.Msg('Button Click', btn);
    };
2.confirm
confirmString title, String msg, [Function fn], [Object scope] ) :
这里的用法和alert相似
 Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult);
 function showResult(btn){
        Ext.Msg('Button Click', btn);
    };
3.Prompt
promptString title, String msg, [Function fn], [Object scope], [Boolean/Number multiline] ) : Ext.MessageBox
Ext.MessageBox.prompt('Name', 'Please enter your name:', showResultText);
function showResultText(btn, text){
        Ext.Msg('Button Click', text);
    };
其中第一个参数是按钮的参数,第二个参数是传递的值,也就是输入之后得到的值
4.Multi-line Prompt
Ext.MessageBox.show({
           title: 'Address',
           msg: 'Please enter your address:',
           width:300,
           buttons: Ext.MessageBox.OKCANCEL,
           multiline: true,
           fn: showResultText,
           animEl: 'mb3',
           icon: Ext.MessageBox.QUESTION
       });

function showResultText(btn, text){
        Ext.Msg('Button Click', text);
    };
其中title是显示的标题,msg是现实的提示消息,width是输入框的宽度,button这里是消息框中显示的按钮,multiline是否多行输入,fn处理函数,icon显示的图标
5.Yes/No/Cancel
Ext.MessageBox.show({
           title:'Save Changes?',
           msg: 'You are closing a tab that has unsaved changes. <br />Would you like to save your changes?',
           buttons: Ext.MessageBox.YESNOCANCEL,
           fn: showResult,
           animEl: 'mb4',
           icon: Ext.MessageBox.QUESTION
       });
6.Progress Dialog

 Ext.MessageBox.show({
           title: 'Please wait',
           msg: 'Loading items...',
           progressText: 'Initializing...',
           width:300,
           progress:true,
           closable:false,
           animEl: 'mb6'
       });

       // this hideous block creates the bogus progress
       var f = function(v){
            return function(){
                if(v == 12){
                    Ext.MessageBox.hide();
                    Ext.example.msg('Done', 'Your fake items were loaded!');
                }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);
       }
下面的一部分是采用定时来刷新进度条,以及显示进度条
7.Wait Dialog
Ext.MessageBox.show({
           msg: 'Saving your data, please wait...',
           progressText: 'Saving...',
           width:300,
           wait:true,
           waitConfig: {interval:200},
           icon:'ext-mb-download', //custom class in msg-box.html
           animEl: 'mb7'
       });
        setTimeout(function(){
            //This simulates a long-running operation like a database save or XHR call.
            //In real code, this would be in a callback function.
            Ext.MessageBox.hide();
            Ext.example.msg('Done', 'Your fake data was saved!');
        }, 8000);
警告里面大概就是这些了,更多的信息可以参考官方的文档