当前位置:   article > 正文

ExtJS Ext.Ajax.request最好设为同步

ext.ajax.request如何设置同步请求

ExtJS 中Ext.Ajax.request最好设为同步,即async: false,因为如果Ajax后面需要用到Ajax更新的数据的话,设置同步,后面才能用到最新的数据。

function GetPatientOrder() {
    Ext.Ajax.request({
        url: '/CommonAshx/Order.ashx',
        method: 'get',
        async: false,
        params: {
            gurd: "GetOrder",
            patientCardNo: Ext.getCmp("CardNo").value
        },
        success: function (response, options) {
            var responseJson = Ext.decode(response.responseText);
            docAdGrid.store.loadData(responseJson.rows);
        },
        failure: function () {
            Ext.Msg.alert("错误", "与后台联系的时候出了问题。");
        }
    });
}

 

转载于:https://www.cnblogs.com/NaughtyBaby/p/4251908.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/322210?site
推荐阅读
相关标签
  

闽ICP备14008679号