解决方案 »

  1.   

    回调函数
    Ext.Msg.confirm('','',functon(name){
       if(name == 'yes') {
         alert(1);
       } else {
          alert(0);
       }
    });
      

  2.   

    我现在想实现一个功能:
    var isRecorded = true/false;
    var needRecord = isRecorded ? false:true;
    if(isRecorded){
    Ext.Msg.confirm(('提示','此节目已录制过,是否重新录制?',function (opt){
    if(opt=='no') return;
    else
    needRecord = true;
    });
    }
    if(needRecord) 打开页面
    但是不行
      

  3.   

    Ext.MessageBox的前面有下面这样一句:
    Note that the MessageBox is asynchronous. 
    这个函数式异步执行的,Ext.Msg.confirm后面的代码在你选择YES和NO之前已经运行完成了,这时needRecord 的值还是初始值,所以你的响应代码还是得放在回调函数里面。
      

  4.   

    confirm是模拟的,无法挂起其他代码执行,都是居于回调的,你要改成回调的形式