【问题标题】:Unable to get callback response in form submit无法在表单提交中获得回调响应
【发布时间】:2013-05-03 20:14:41
【问题描述】:

我快疯了。我已经阅读了论坛,问题,答案,没有办法得到回调响应! 我的代码:

var myFormTest = new Ext.form.FormPanel({
renderTo: 'divAllegati',
width: 500,
title: 'Allegati',
bodyPadding: '10 10 0',
standardSubmit: true,
items: [{
    xtype: 'textfield',
    fieldLabel: 'Name',
name: 'ciao',
value: 'ciao'
},{
    xtype: 'filefield',
    id: 'form-file',
    emptyText: 'Seleziona un file',
    fieldLabel: 'Allegato',
    name: 'photo-path',
    buttonText: '',
    buttonConfig: {
        iconCls: 'upload-icon'
    }
}],
buttons: [{
    text: 'Save',
handler: function(){
    if (myFormTest.getForm().isValid()) {
        myFormTest.getForm().submit({
        url: '/uploadAllegati',
        waitMsg: 'Caricamento allegati...',
        success: function (form, action) {
            Ext.Msg.alert('Success');
        },
        failure: function (form, action) {
            Ext.Msg.alert('Failure');
        }                                   
            });
    }
    }
}]

});

没有办法获得成功或失败! 我的服务器发回这个:

ResponseInfo.ResponseNo := 200;
ResponseInfo.ContentType := 'text/html';
ResponseInfo.ContentText := '{success:true}';

但我得到的只是一个空白页

{成功:真}

没有消息,没有警报,没有回调......

请帮忙,真的要疯了!

【问题讨论】:

    标签: extjs extjs4.2


    【解决方案1】:
    standardSubmit: false,//true, <---------
    

    【讨论】:

    • Nooooooooo 请不要那么容易!!!!只是为此而疯狂....现在它可以工作了...真的非常感谢!!!!
    【解决方案2】:

    解决了standardSubmit: false 有时,容易的事情是看不见的:D 我尝试了任何方法来解决我的问题,以任何方式更改了我的服务器,但我没有找到正确的答案。 谢谢弗拉德!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-11
      • 1970-01-01
      • 2017-05-10
      • 2015-05-15
      • 2019-01-12
      • 1970-01-01
      • 2015-04-21
      • 2012-07-25
      相关资源
      最近更新 更多