Extjs 等待提示的几种方式
来源:互联网 发布:淘宝店铺图文详情 编辑:程序博客网 时间:2024/06/03 12:43
1.Store加载信息等待
ExtJs的Store在加载时候一般是延迟加载的,这时候Grid就会先出现一片空白,等加载完成后才出现数据;因此,我们需要给它添加一个提示信息!
但是Store却没有waitMsg属性。
解决方案:
1.给store添加监听器,监听beforeload事件,加载前弹出提示框,加载完成后关闭提示框
2.callback为load的回调函数,在加载完成后执行,因此关闭提示框由它完成;
3.一定要给store的reload方法也添加callback函数,已关闭提示框
例子主要代码如下:
var msgTip; // 一定要定义在使用前,且定义为全局变量
var reportStore=new Ext.data.Store({
proxy:reportProxy,
reader:reportReader,
listeners:{
beforeload:function(){
msgTip = Ext.MessageBox.show({
title:'提示',
width : 250,
msg:'页面报表统计信息刷新中,请稍后......'
});
}
}
});
reportStore.load({
callback: function(records, options, success){
msgTip.hide(); // 加载完成,关闭提示框
}
});
注意:如果有调用reload来重新刷新页面,reload也要添加callback函数来关闭提示框
reportStore.reload({
callback: function(records, options, success){
msgTip.hide(); // 加载完成,关闭提示框
}
});
参考:http://blog.sina.com.cn/s/blog_67cc6e7d0100ox6t.html
2.Ext.ajax.Request的等待提示
var nwin = new Ext.Window({
title: '编辑',
modal : true,
closeAction : 'close',
buttonAlign : 'center',
width : 400,
height : 300,
layout : 'fit',
items: assignmentZDGrid,
buttons: [{text: '确定',handler: function(){
var myMask = new Ext.LoadMask(Ext.getBody(), {
msg: '正在保存,请稍后!',
removeMask: true //完成后移除
});
myMask.show();
var ids="";
var codes="";
for(var i=0;i <assignmentZDGrid.getStore().getCount();i++)
{ var id=assignmentZDGrid.getStore().getAt(i).get("type")+":"+assignmentZDGrid.getStore().getAt(i).get("id");
ids+=id+",";
var code=assignmentZDGrid.getStore().getAt(i).get("codeid");
codes+=code+",";
}
Ext.Ajax.request({
url : './flow/saveProcessorsForCurrent.html',
method : 'POST',
params : {ids : ids,codes : codes},
success : function(response, options) {
var responseArray = Ext.util.JSON.decode(response.responseText);
myMask.hide();
formView.grid.getStore().load();
Ext.Msg.alert('消息',responseArray.msg);
nwin.close();
}
});
}},{text: '取消',handler :function(){nwin.close();}}]
});
- Extjs 等待提示的几种方式
- 线程等待的几种方式
- Extjs 创建数据的几种方式
- Extjs的几种交互方式
- Extjs的几种简单的提示框
- 图片旋转(扫描,等待效果)的几种方式
- input 显示提示的几种方式。
- ExtJS的几种提交方式(6种)
- ExtJS Grid tooltip的几种实现方式
- Extjs 给 Grid 加上tooltip的几种实现方式
- Extjs form提交数据的几种方式
- ExtJs中Store的几种加载方式
- ExtJs获取文本框中值的几种方式
- ExtJS改变默认字体大小的几种方式
- (五)ExtJs进度条的几种实现方式
- 页面提示框的几种常见的方式
- BlackBerry WebWorks 手机应用提示用户的几种方式
- 关于input提示文字的几种实现方式
- 动态代理(1,umeng 自定义事件的统计,2,非侵入式的性能测量方法 )
- JS 从URL获取参数方法
- JQuery中根据属性或属性值获得元素
- Ext获取表单中列行值
- Docker 网络(十三)—— Calico for Docker
- Extjs 等待提示的几种方式
- Extjs 前台分页(假分页)
- Extjs关于FormPanel布局
- WritableWorkbook 详细用例
- Mybatis 一对多(OneToOne)关系映射
- Android之Activity(七):启动活动的最佳写法
- 【转载】struts+spring+hibernate无法插入数据库数据的问题
- Struts2 用 s:if test 判断属性和字符串相等时 注意双引号和单引号的使用
- SQL使用场景和记录