Ext.onReady(function(){
Ext.get('mb1').on('click', function(e){ //提示信息:确认信息提示
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult); (标题,提示信息,调用function名字)
});
Ext.get('mb2').on('click', function(e){ //信息提示:弹出输入text,获取输入信息
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, //调用js
animateTarget: 'mb3'
});
});
Ext.get('mb4').on('click', function(e){ //信息提示:信息提示 ok 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,
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('mb8').on('click', function(){ //信息提示:弹出信息处理
Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);
});
});
Ext.get('mb1').on('click', function(e){ //提示信息:确认信息提示
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult); (标题,提示信息,调用function名字)
});
Ext.get('mb2').on('click', function(e){ //信息提示:弹出输入text,获取输入信息
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, //调用js
animateTarget: 'mb3'
});
});
Ext.get('mb4').on('click', function(e){ //信息提示:信息提示 ok 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,
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('mb8').on('click', function(){ //信息提示:弹出信息处理
Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);
});
});