来源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...
}
});
评论
tacone
搜索本博客
最近加入圈子
存档
最新评论