一、提示框(Ext.MessageBox.alert 或 Ext.Msg.alert)
alert( String title, String msg, [Function fn], [Object scope] ) :
title:标题
msg:显示内容
fn:回调函数
scope:作用域
- <script type="text/javascript">
- Ext.onReady( function(){
- Ext.MessageBox.alert(\'Alert\',\'弹出窗口Alert\',function(){alert(\'abc\')});
- }
- );
- </script>
- <script type="text/javascript">
- Ext.onReady( function(){
- Ext.MessageBox.alert(\'Alert\',\'弹出窗口Alert\',function(){alert(\'abc\')});
- }
- );
- </script>
二、对话框(Ext.MessageBox.confirm 或 Ext.Msg.confirm)
confirm( String title, String msg, [Function fn], [Object scope] )
title:标题
msg:显示内容
fn:回调函数
- <script type="text/javascript">
- Ext.onReady( function(){
- Ext.MessageBox.confirm( "请确认", "是否要删除指定内容", function(button,text){
- alert(button);
- } );
- }
- );
- </script>
- <script type="text/javascript">
- Ext.onReady( function(){
- Ext.MessageBox.confirm( "请确认", "是否要删除指定内容", function(button,text){
- alert(button);
- } );
- }
- );
- </script>
三、对话框(Ext.MessageBox.prompt 或 Ext.Msg.prompt )
prompt( String title, String msg, [Function fn], [Object scope] )
title:标题
msg:显示内容
fn:回调函数
- <script type="text/javascript">
- Ext.onReady( function(){
- Ext.MessageBox.prompt( "输入提示框", "请输入您的年龄", function(button,text){
- alert(button);
- alert(text);
- } );
- }
- );
- </script>
- <script type="text/javascript">
- Ext.onReady( function(){
- Ext.MessageBox.prompt( "输入提示框", "请输入您的年龄", function(button,text){
- alert(button);
- alert(text);
- } );
- }
- );
- </script>
四、对话框(Ext.MessageBox.show 或 Ext.MsgBox.show)
- Ext.onReady( function(){
- Ext.MessageBox.show( {
- title:"保存数据",
- msg:"你已经作了一些数据修改,是否要保存当前内容的修改?",
- buttons:Ext.Msg.YESNOCANCEL,
- fn:save,
- icon:Ext.MessageBox.QUESTION});
- }
- );
- Ext.onReady( function(){
- Ext.MessageBox.show( {
- title:"保存数据",
- msg:"你已经作了一些数据修改,是否要保存当前内容的修改?",
- buttons:Ext.Msg.YESNOCANCEL,
- fn:save,
- icon:Ext.MessageBox.QUESTION});
- }
- );