码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-01-27 10:39:11      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

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("错误", "与后台联系的时候出了问题。");
        }
    });
}

 

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

标签:

原文地址:http://www.cnblogs.com/NaughtyBaby/p/4251908.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!