先看看LoadMask, 注意 show和hide两个函数的调用. 在api文档中没有给出来..第一个参数是某元素的id值,当加载的时候, id的元素变成灰色的不可用状态.
var mk = new Ext.LoadMask(tree.id, {
msg: '正在更新数据,请稍候!',
removeMask: true //完成后移除
});
mk.show(); //显示
Ext.Ajax.request({
url: 'roleAction.evi', // 发送get请求.
method: 'GET',
success: function() {
mk.hide(); //关闭
},
failure: function() { mk.hide(); }
});
对于 Ajax, 最要注意的是 request的参数.
看文档:
An object which may contain the following properties:
url : String (Optional)
The URL to which to send the request. Defaults to configured URL
params : Object/String/Function (Optional)
An object containing properties which are used as parameters to the request, a url encoded string or a function to call to get either.
method : String (Optional)
The HTTP method to use for the request. Defaults to the configured method, or if no method was configured, "GET" if no parameters are being sent, and "POST" if parameters are being sent.
callback : Function (Optional)
The function to be called upon receipt of the HTTP response. The callback is called regardless of success or failure and is passed the following parameters:
options : Object
The parameter to the request call.
success : Boolean
True if the request succeeded.
response : Object
The XMLHttpRequest object containing the response data. See http://www.w3.org/TR/XMLHttpRequest/ for details about accessing elements of the response.
success : Function (Optional)
The function to be called upon success of the request. The callback is passed the following
--- parameters:
response : Object
The XMLHttpRequest object containing the response data.
options : Object
The parameter to the request call.
failure : Function (Optional)
The function to be called upon failure of the request. The callback is passed the following
--- parameters:
response : Object
The XMLHttpRequest object containing the response data.
options : Object
The parameter to the request call.
scope : Object (Optional)
The scope in which to execute the callbacks: The "this" object for the callback function. Defaults to the browser window.
form : Object/String (Optional)
A form object or id to pull parameters from.
isUpload : Boolean (Optional)
True if the form object is a file upload (will usually be automatically detected).
headers : Object (Optional)
Request headers to set for the request.
xmlData : Object (Optional)
XML document to use for the post. Note: This will be used instead of params for the post data. Any params will be appended to the URL.
jsonData : Object/String (Optional)
JSON data to use as the post. Note: This will be used instead of params for the post data. Any params will be appended to the URL.
disableCaching : Boolean (Optional)
True to add a unique cache-buster param to GET requests.




















