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

来源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...
    }
});

你可能感兴趣的:(html,PHP,Blog,ext)