ext中alert点击确定之后再执行其他动作,该如何控制?
问题描述:
ext中alert点击确定之后再执行其他动作,该如何控制?
答
Ext.Msg.alert('Status', 'Changes saved successfully.',function(){
//点击后的操作在这里执行
});
答
// 基本的alert:
Ext.Msg.alert('Status', 'Changes saved successfully.',function(){
});
// 用户对话框,用一个回调函数处理结果:
Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
if (btn == 'ok'){
// 处理文本值,然后关闭...
}
});
// 使用配置选项显示一个对话框:
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,
fn: processResult,
animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});
多看API