论坛首页 Web前端技术论坛

学习和应用extjs Developing with Extjs - tricks and tips. (2)

浏览 2233 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-08-17  
来源http://www.akbkhome.com/blog.php/View/137/Developing_with_Extjs__tricks_and_tips.html
接触Extjs's XMLHttpRequest 调用
Extjs's XMLHttpRequest 可以取代传统德XMLHttp来调用远程服务
例如:
dialog.el.mask("Saving...");
var con = new Ext.data.Connection();
con.request({
    url: baseURL + "/mypage.txt", // where to post to..
    params: params, // << key value object with data to send
    method: 'POST',
    callback: function(opts, success, response)  {
        dialog.el.unmask(true); // unmask the dialog.
    if (!success || ("OK" != response.responseText)) {
             Ext.MessageBox.alert("Error", success ?
                                  response.responseText  :
                          "Error saving data - try again");
             return;
        }
        dialog.hide();       
        // code to update stuff that's affected by the saved form working..    
        // goes here...
    }
});
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics