请问大家
ext的desktop页怎么提交表单我使用 网上的方法 在 desktop.html 写入了代码new Ext.form.FormPanel({
    labelAlign: 'left',
    labelWidth: 60,
    title: '请选择查询条件',
    frame: true,
    width: 300,
    formId: 'simpleForm',
    name: 'simpleForm',
    onSubmit: Ext.emptyFn,
    submit: function() {
        this.getEl().dom.action = 'yes.html'; 
        this.getEl().dom.target = "_blank";
        this.getEl().dom.submit();
     },
    items: [{
    ……
    ……
   }],
        buttons: [{
            text: '查 询',
            handler: function() { simpleForm.submit(); }
        }, {
            text: '取 消',
            handler: function() { simpleForm.reset(); }
  }]
    ……
    ……但是每当点击 查询 的时候 无法跳转
而且ie地址栏还是显示 desktop.html 
同时 也页面提示 "该页无法显示"请问大家 这是怎么回事应该怎么修改
谢谢了 

解决方案 »

  1.   


    simpleForm.getForm().submit({
        clientValidation: true,
        url: 'updateConsignment.php',
        params: {
            newStatus: 'delivered'
        },
        success: function(form, action) {
           Ext.Msg.alert('Success', action.result.msg);
        },
        failure: function(form, action) {
            switch (action.failureType) {
                case Ext.form.Action.CLIENT_INVALID:
                    Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                    break;
                case Ext.form.Action.CONNECT_FAILURE:
                    Ext.Msg.alert('Failure', 'Ajax communication failed');
                    break;
                case Ext.form.Action.SERVER_INVALID:
                   Ext.Msg.alert('Failure', action.result.msg);
           }
        }
    });
      

  2.   


    谢谢1楼的但是 我加入你的代码如下        buttons: [{
                text: '查 询',
                handler: function() {
                //            simpleForm.submit();            simpleForm.getForm().submit({  //提示这里错误
                    clientValidation: true,
                    url: 'updateConsignment.php',
                    params: {
                        newStatus: 'delivered'
                    },
                    success: function(form, action) {
                        Ext.Msg.alert('Success', action.result.msg);
                    },
                    failure: function(form, action) {
                        switch (action.failureType) {
                            case Ext.form.Action.CLIENT_INVALID:
                                Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                                break;
                            case Ext.form.Action.CONNECT_FAILURE:
                                Ext.Msg.alert('Failure', 'Ajax communication failed');
                                break;
                            case Ext.form.Action.SERVER_INVALID:
                                Ext.Msg.alert('Failure', action.result.msg);
                        }
                    }
                });
                }
            }, {
                text: '取 消',
                handler: function() { simpleForm.reset(); }
    }]
    网页就会提示错误 :
     对象不支持此属性或方法 (错误行在代码中表示出)若我将 那行代码 修改为 simpleForm.submit 就会出现原来的错误请问 这是 什么回事再次感谢 
      

  3.   

    自己查API啊,form可以根据formid来提交。楼上的也是跟你说的整个道理。
      

  4.   

     Ext.get('simpleForm').getForm().submit 
      

  5.   


    Ext.get('simpleForm').submit({
        clientValidation: true,//这个是form是否验证
        url: 'page/index.action',//要提交到后天的action
        params: {
            newStatus: 'delivered'//这个是你传到后天的参数可以不去掉不带
        },
        success: function(form, action) {
           Ext.Msg.alert('Success', action.result.msg);
        },
        failure: function(form, action) {
            switch (action.failureType) {
                case Ext.form.Action.CLIENT_INVALID:
                    Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                    break;
                case Ext.form.Action.CONNECT_FAILURE:
                    Ext.Msg.alert('Failure', 'Ajax communication failed');
                    break;
                case Ext.form.Action.SERVER_INVALID:
                   Ext.Msg.alert('Failure', action.result.msg);
           }
        }
    });
      

  6.   

    Ext.get('simpleForm').getForm().submit({
        clientValidation: true,//这个是form是否验证
        url: 'page/index.action',//要提交到后天的action
        params: {
            newStatus: 'delivered'//这个是你传到后天的参数可以不去掉不带
        },
        success: function(form, action) {
           Ext.Msg.alert('Success', action.result.msg);
        },
        failure: function(form, action) {
            switch (action.failureType) {
                case Ext.form.Action.CLIENT_INVALID:
                    Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                    break;
                case Ext.form.Action.CONNECT_FAILURE:
                    Ext.Msg.alert('Failure', 'Ajax communication failed');
                    break;
                case Ext.form.Action.SERVER_INVALID:
                   Ext.Msg.alert('Failure', action.result.msg);
           }
        }
    });
      

  7.   

    楼上的 谢谢 您的 注释 和 答复我问问  
    你给的代码是否加到 buttons: [{
                text: '查 询',
                handler: function() { //加入到这里?? }
            }, ……如果是 程序还是会提示 对象不支持此属性或方法 
    请问这是怎么回事
      

  8.   


    new Ext.form.FormPanel({
      labelAlign: 'left',
      labelWidth: 60,
      title: '请选择查询条件',
      frame: true,
      width: 300,
      id: 'simpleForm',
      name: 'simpleForm',
      onSubmit: Ext.emptyFn,
      submit: function() {
      this.getEl().dom.action = 'yes.html';  
      this.getEl().dom.target = "_blank";
      this.getEl().dom.submit();
      },
      items: [{
      ……
      ……
      }],
      buttons: [{
      text: '查 询',
      handler: function() { 
          Ext.get('simpleForm').getForm().submit({// Ext.get('simpleForm')这个是通过formpanel的id获取formpanel对象,然后提交该对象
        clientValidation: true,//这个是form是否验证
        url: 'page/index.action',//要提交到后天的action
        params: {
            newStatus: 'delivered'//这个是你传到后天的参数可以不去掉不带
        },
        success: function(form, action) {
           Ext.Msg.alert('Success', action.result.msg);
        },
        failure: function(form, action) {
            switch (action.failureType) {
                case Ext.form.Action.CLIENT_INVALID:
                    Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                    break;
                case Ext.form.Action.CONNECT_FAILURE:
                    Ext.Msg.alert('Failure', 'Ajax communication failed');
                    break;
                case Ext.form.Action.SERVER_INVALID:
                   Ext.Msg.alert('Failure', action.result.msg);
           }
        }
    });
     }
      }, {
      text: '取 消',
      handler: function() { simpleForm.reset(); }
      }]
      

  9.   


     formId: 'simpleForm'改为id: 'simpleForm'
      

  10.   


    new Ext.form.FormPanel({
      labelAlign: 'left',
      labelWidth: 60,
      title: '请选择查询条件',
      frame: true,
      width: 300,
      id: 'simpleForm',
      name: 'simpleForm',
      onSubmit: Ext.emptyFn,
      submit: function() {
      this.getEl().dom.action = 'yes.html';  
      this.getEl().dom.target = "_blank";
      this.getEl().dom.submit();
      },
      items: [{
      ……
      ……
      }],
      buttons: [{
      text: '查 询',
      handler: function() { 
          Ext.getCmp('simpleForm').getForm().submit({// Ext.get('simpleForm')这个是通过formpanel的id获取formpanel对象,然后提交该对象
        clientValidation: true,//这个是form是否验证
        url: 'page/index.action',//要提交到后天的action
        params: {
            newStatus: 'delivered'//这个是你传到后天的参数可以不去掉不带
        },
        success: function(form, action) {
           Ext.Msg.alert('Success', action.result.msg);
        },
        failure: function(form, action) {
            switch (action.failureType) {
                case Ext.form.Action.CLIENT_INVALID:
                    Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                    break;
                case Ext.form.Action.CONNECT_FAILURE:
                    Ext.Msg.alert('Failure', 'Ajax communication failed');
                    break;
                case Ext.form.Action.SERVER_INVALID:
                   Ext.Msg.alert('Failure', action.result.msg);
           }
        }
    });
     }
      }, {
      text: '取 消',
      handler: function() { Ext.getCmp('simpleForm').getForm().reset(); }
      }]
      

  11.   

    非常感谢 leehuat 的 耐心解答
    给分