Home
JavaEE
Java GUI
Framework
DHtml
Android
插画
教程下载

ATOM 2.0   RSS 2.0
Add to iGoogle Add to Live.com
  • 今天终于收到金山快盘的邀请码
  • 利用最短ie判断在不同浏览器上播放背景音乐
  • 对插画方面的一点感受与回忆
  • 网上看到的两个死里逃生的图片,记录一下
  • 今天开通了糖果社区,附几个激活码
  • 终于可以实现我的多个微博实时同步了
  • 备案和现场拍照就是对站长们的瞎折腾
  • 对Android在互联网应用开发上的纠结
  • 收藏夹中的书签都没了,决定写一个自已的书签管理器
  • 测试自已整理的本机的webapps客户端发送博文能否成功。
  • 今天开通了糖果社区,附几个激活码
  • 终于可以实现我的多个微博实时同步了
  • 备案和现场拍照就是对站长们的瞎折腾
  • 昨天借用飞姐的佳作做的一个浪漫爱情网页
  • 有几个腾讯微博的邀请码(实时更新)
  • BB的网站移到了GAE-JAVA上了
  • 一个基于GAE Python Web.py和JQuery的留言本程序
  • 类许愿墙的一个告白网站和一个电子书网站
  • Android中用Bitmap获取图片中某个区域的图象
  • 对暴力破解带密码的QQ相册的可行性分析
  • 对淘宝web旺旺版一些通讯接口的研究

Extjs的LoadMask与Ajax的应用

posted by David Chen at July 4, 2008, 9:45 AM    

先看看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.
Labels:   ExtJs    DHtml  
Trackback:   http://cwq.iou1314.com/extjs-loadmask-ajax_a328
微博最近更新
[2010-07-31 16:33]    今天下午又将昨天赢的哎齐出来了,郁闷,一进一出,要有入没出才行啊。
[2010-07-31 07:40]    昨晚又去啊泄度开台,呢次赢左差唔多3旧水,下周星期一请假,回郁南去转社保和入党资料。
本站内的任何文章,只代表个人意见或学习所用,如有版权声明,请尊重作者的劳动成果,在转载时请保留原始链接并注明出处。
Power by David's PhpCms, © 2007 - 2010 CWQ.IOU1314.COM All Rights Reserved.