<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Advanced Ext.ux.StatusBar Example</title>
<!-- Ext -->
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<script type="text/javascript" src="extjs/ext-all.js"></script>
<script type="text/javascript" src="extjs/msgBox.js"></script>
</head>
<body>
<p>
<b>Confirm</b><br />
Standard Yes/No dialog.
<button id="mb1">Show</button>
</p>
<p>
<b>Prompt</b><br />
Standard prompt dialog.
<button id="mb2">Show</button>
</p>
<p>
<b>Multi-line Prompt</b><br />
A multi-line prompt dialog.
<button id="mb3">Show</button>
</p>
<p>
<b>Yes/No/Cancel</b><br />
Standard Yes/No/Cancel dialog.
<button id="mb4">Show</button>
</p>
<p>
<b>Progress Dialog</b><br />
Dialog with measured progress bar.
<button id="mb6">Show</button>
</p>
<p>
<b>Wait Dialog</b><br />
Dialog with indefinite progress bar and custom icon (will close after 8 sec).
<button id="mb7">Show</button>
</p>
<p>
<b>Alert</b><br />
Standard alert message dialog.
<button id="mb8">Show</button>
</p>
<p>
<b>Icons</b><br />
Standard alert with optional icon.
<select id="icons">
<option id="error" selected="selected">Error</option>
<option id="info">Informational</option>
<option id="question">Question</option>
<option id="warning">Warning</option>
</select>
<button id="mb9">Show</button>
</p>
<p>
<b>Custom button text</b><br />
MessageBox with custom button text.
<button id="mb10">Show</button>
</p>
</body>
msgBox.js
Ext.onReady(function(){
Ext.get('mb1').on('click', function(e){
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult);
});
Ext.get('mb2').on('click', function(e){
Ext.MessageBox.prompt('Name', 'Please enter your name:', showResultText);
});
Ext.get('mb3').on('click', function(e){
Ext.MessageBox.show({
title: 'Address',
msg: 'Please enter your address:',
width:300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: showResultText,
animateTarget: 'mb3'
});
});
Ext.get('mb4').on('click', function(e){
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,
animateTarget: 'mb4',
icon: Ext.MessageBox.QUESTION
});
});
Ext.get('mb6').on('click', function(){
Ext.MessageBox.show({
title: 'Please wait',
msg: 'Loading items...',
progressText: 'Initializing...',
width:300,
progress:true,
closable:false,
animateTarget: '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);
}
});
Ext.get('mb7').on('click', function(){
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
animateTarget: '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);
});
Ext.get('mb8').on('click', function(){
Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);
});
//Add these values dynamically so they aren't hard-coded in the html
Ext.fly('info').dom.value = Ext.MessageBox.INFO;
Ext.fly('question').dom.value = Ext.MessageBox.QUESTION;
Ext.fly('warning').dom.value = Ext.MessageBox.WARNING;
Ext.fly('error').dom.value = Ext.MessageBox.ERROR;
Ext.get('mb9').on('click', function(){
Ext.MessageBox.show({
title: 'Icon Support',
msg: 'Here is a message with an icon!',
buttons: Ext.MessageBox.OK,
animateTarget: 'mb9',
fn: showResult,
icon: Ext.get('icons').dom.value
});
});
Ext.get('mb10').on('click', function(){
Ext.MessageBox.show({
title: 'What, really?',
msg: 'Are you sure?',
buttons: Ext.MessageBox.YESNO,
buttonText:{
yes: "Definitely!",
no: "No chance!"
},
fn: showResult
});
});
function showResult(btn){
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
};
function showResultText(btn, text){
Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
};
});
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Advanced Ext.ux.StatusBar Example</title>
<!-- Ext -->
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<script type="text/javascript" src="extjs/ext-all.js"></script>
<script type="text/javascript" src="extjs/msgBox.js"></script>
</head>
<body>
<p>
<b>Confirm</b><br />
Standard Yes/No dialog.
<button id="mb1">Show</button>
</p>
<p>
<b>Prompt</b><br />
Standard prompt dialog.
<button id="mb2">Show</button>
</p>
<p>
<b>Multi-line Prompt</b><br />
A multi-line prompt dialog.
<button id="mb3">Show</button>
</p>
<p>
<b>Yes/No/Cancel</b><br />
Standard Yes/No/Cancel dialog.
<button id="mb4">Show</button>
</p>
<p>
<b>Progress Dialog</b><br />
Dialog with measured progress bar.
<button id="mb6">Show</button>
</p>
<p>
<b>Wait Dialog</b><br />
Dialog with indefinite progress bar and custom icon (will close after 8 sec).
<button id="mb7">Show</button>
</p>
<p>
<b>Alert</b><br />
Standard alert message dialog.
<button id="mb8">Show</button>
</p>
<p>
<b>Icons</b><br />
Standard alert with optional icon.
<select id="icons">
<option id="error" selected="selected">Error</option>
<option id="info">Informational</option>
<option id="question">Question</option>
<option id="warning">Warning</option>
</select>
<button id="mb9">Show</button>
</p>
<p>
<b>Custom button text</b><br />
MessageBox with custom button text.
<button id="mb10">Show</button>
</p>
</body>
msgBox.js
Ext.onReady(function(){
Ext.get('mb1').on('click', function(e){
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult);
});
Ext.get('mb2').on('click', function(e){
Ext.MessageBox.prompt('Name', 'Please enter your name:', showResultText);
});
Ext.get('mb3').on('click', function(e){
Ext.MessageBox.show({
title: 'Address',
msg: 'Please enter your address:',
width:300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: showResultText,
animateTarget: 'mb3'
});
});
Ext.get('mb4').on('click', function(e){
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,
animateTarget: 'mb4',
icon: Ext.MessageBox.QUESTION
});
});
Ext.get('mb6').on('click', function(){
Ext.MessageBox.show({
title: 'Please wait',
msg: 'Loading items...',
progressText: 'Initializing...',
width:300,
progress:true,
closable:false,
animateTarget: '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);
}
});
Ext.get('mb7').on('click', function(){
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
animateTarget: '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);
});
Ext.get('mb8').on('click', function(){
Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);
});
//Add these values dynamically so they aren't hard-coded in the html
Ext.fly('info').dom.value = Ext.MessageBox.INFO;
Ext.fly('question').dom.value = Ext.MessageBox.QUESTION;
Ext.fly('warning').dom.value = Ext.MessageBox.WARNING;
Ext.fly('error').dom.value = Ext.MessageBox.ERROR;
Ext.get('mb9').on('click', function(){
Ext.MessageBox.show({
title: 'Icon Support',
msg: 'Here is a message with an icon!',
buttons: Ext.MessageBox.OK,
animateTarget: 'mb9',
fn: showResult,
icon: Ext.get('icons').dom.value
});
});
Ext.get('mb10').on('click', function(){
Ext.MessageBox.show({
title: 'What, really?',
msg: 'Are you sure?',
buttons: Ext.MessageBox.YESNO,
buttonText:{
yes: "Definitely!",
no: "No chance!"
},
fn: showResult
});
});
function showResult(btn){
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
};
function showResultText(btn, text){
Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
};
});
发表评论
-
extjs4.1几种布局方式
2013-02-18 15:32 886http://blog.csdn.net/yunji3344/ ... -
extjs4.1 几种绘图
2013-02-18 15:06 934draw.js Ext.onReady(function( ... -
extjs4.2 form
2013-02-02 14:43 2032form.js Ext.require([ //'E ... -
extjs4.2 login,window
2013-02-01 17:38 1783Login: <!DOCTYPE HTML PUBLI ... -
JS学习,教程
2012-10-11 21:57 636JS 学习中。。。。
相关推荐
EXTjs4.2中文版是EXTjs框架的一个重要版本,EXTjs是一个强大的JavaScript库,专门用于构建用户界面,尤其适用于创建富互联网应用程序(Rich Internet Applications,简称RIA)。它以其组件化的设计理念,丰富的UI...
01.教程简介_ExtJS4.2简介_SSH2基本框架搭建 02.编写几个通用的service方法、设计数据库 03.搭建ExtJS的MVC框架 04.主界面的搭建、登录功能和菜单树的生成 05.创建菜单树、前台保存用户信息 06.菜单树响应事件、我的...
在本实践项目“SpringMVC+ExtJs4.2实例”中,我们将深入探讨如何将SpringMVC框架与ExtJs4.2前端框架相结合,构建一个功能完善的Web应用程序。这个项目旨在展示如何利用这两个强大的技术栈来实现数据的动态交互和用户...
这是利用sencha cmd 生成的GridFilterDemo工程中的app和build文件夹,其余文件过大并且与主题无关,因此未包含。具体方法,请参看我的博客: 《Extjs4.2 Grid Filter Feature 表格过滤特性》
ExtJs4.2没有直接提供下拉树这个组件,但是有例子可以用,文件位置:ext-4.2.1.883\examples\ux\TreePicker.js 但是它有点小毛病吧:默认显示了根节点;达到最小高度时再展开节点,高度不能自动调整。 所以我做了一...
EXTJS4.2学习入门教程 EXTJS4.2学习入门教程 EXTJS4.2学习入门教程
ExtJS 4.2 是一个流行的JavaScript框架,用于构建富客户端Web应用程序。它提供了一套完整的组件库,包括数据管理、图表、表格、菜单、工具栏等,使得开发者能够创建功能丰富的、交互式的用户界面。这本书籍《ExtJS ...
Extjs官方文档 帮助你更好的学习Extjs,同事这里面的代码是最完整,最规范的。
根据提供的文件信息,本文将详细解释ExtJs 4.2中Window组件的一些常用配置属性以及方法,帮助读者更好地理解和使用这些功能。 ### ExtJs 4.2 Window 组件概述 ExtJs 是一个基于 JavaScript 的开源框架,用于创建...
在这个“下拉(条件)搜索实例”中,我们看到开发者利用ExtJS 4.2实现了一个交互式的用户界面,其中包含了下拉菜单和条件搜索功能。 下拉搜索通常指的是在输入框中使用下拉列表作为候选选项的搜索方式,用户可以快速...
Extjs4.2入门教程详解,及API文档。
WMC2.0-Client.zip是一个基于Extjs4.2的开发框架,其实是个只有大框架的,并没有其他功能,您可能会骂我标题党“通用权限管理系统,通用后台模板”,呵呵,其实不是这样的。 整个WMC系统分为WMC2.0-Server服务端...
用Ext编写的多文件上传组件,已封装。 支持多文件上传,文件下载,文件删除,
EXTJS 4.2 Desktop MVC 是一个基于EXTJS 4.2版本的桌面应用程序框架,它结合了MVC(Model-View-Controller)设计模式,为开发者提供了构建富客户端桌面应用的强大工具。EXTJS是一个流行的JavaScript库,专门用于创建...
extjs 4.2 jsb2 4.2没有自带jsb2文件
ExtJs4.2正式版
标题 "nodejs+extjs4.2+mysql" 暗示了这是一个使用 Node.js、ExtJS 4.2 和 MySQL 数据库构建的项目。这个项目的核心是利用这些技术搭建了一个基本的框架,使得开发者可以方便地在此基础上添加自己的业务逻辑和功能。...
php+extjs4.2翻页搜索实例.php
ExtJS4.2入门案例 博客:http://blog.csdn.net/coco2d_x2014/article/details/52986835