【问题标题】:Unable to get the JSON response from server into the store after form submission in Extjs在 Extjs 中提交表单后,无法从服务器获取 JSON 响应到存储中
【发布时间】:2013-04-18 15:33:53
【问题描述】:

我有一个登录表单,它在单击提交按钮时将用户名、密码值提交给服务器。

var form = this.up('form').getForm();
    if (form.isValid()) {
        form.submit({
            url: '', //this is the url where the form gets submitted
            success: function(form, action) {
               Ext.Msg.alert('Success', action.result.msg);
            },
            failure: function(form, action) {
                Ext.Msg.alert('Failed', action.result.msg);
            }
        });
    }

但是在点击提交按钮后,网页(Web 应用程序)被重定向到我为表单提交提供的 URL,显示来自服务器的响应。

我需要将来自服务器的 JSON 响应存储到存储中,而不会被重定向并停留在同一页面上。

请帮我解决这个问题。

提前致谢。

【问题讨论】:

    标签: php json extjs


    【解决方案1】:

    设置form的standardSubmit属性为false:

    Ext.create('Ext.form.Panel', {
        standardSubmit: false,
        ...
    

    【讨论】:

      猜你喜欢
      • 2013-06-03
      • 1970-01-01
      • 2013-10-13
      • 2013-02-02
      • 2017-06-25
      • 1970-01-01
      • 2015-06-28
      • 1970-01-01
      • 2012-12-07
      相关资源
      最近更新 更多