楼主最近遇到一个需求就在在ext 框架里实现右下角弹框提示,就自己动手做了一个
2017-10-25 13:27
525 查看
function loadData(){
var obj={};
/*obj.userId=userId;*/
obj.messageState=0;
Ext.Ajax.request({
url : 'system/queryListNP_message.action', // 请求地址
method : 'POST',
// 提交参数组
params : {
jsonString : Ext.encode(obj)
},
// 成功时回调
success : function(response, options) {
// 获取响应的json字符串
var jsonString = Ext.decode(response.responseText).jsonString;
var list = Ext.decode(jsonString);
if(list.length>0){
var htmlStr='<table id="messageTable">';
for(var i=0;i<list.length;i++){
htmlStr+='<tr id="message_'+list[i].messageId+'">';
htmlStr+='<td><a href="javascript:goToAskList('+list[i].messageId+');" style="color: #2e86b6; text-decoration: none">'+list[i].messageTitle+'</a></td></tr>';
}
htmlStr+='</table>';
if (tipWin) {
tipWin.update('<center>'+htmlStr+'</center>');//面板存在就更新面板里面的提示消息
}else{
tipWin = Ext.create('oa.ux.Notice', { //创建消息面板
title : '消息',
width : 190,
height : 100,
stickWhileHover: true,
autoScroll: true,
html: '<center>'+htmlStr+'</center>'
});
}
tipWin.show();
}else{
if (tipWin) {
tipWin.hide();
}
}
},
failure : function(response, options) {
}
});
}
需要注意的是 因为在ext 中所以首先要把js引入进来,一般是这种方式
requires : [
'oa.ux.Vtype',
'oa.ux.Notice', //需要引入的js 原名叫做Notification.js
'oa.util.Power',
'oa.util.DES3',
'oa.util.Encrypt',
'oa.CommonAndLoadFirst', // 最先加
使用的时候也要用这种方式
var obj={};
/*obj.userId=userId;*/
obj.messageState=0;
Ext.Ajax.request({
url : 'system/queryListNP_message.action', // 请求地址
method : 'POST',
// 提交参数组
params : {
jsonString : Ext.encode(obj)
},
// 成功时回调
success : function(response, options) {
// 获取响应的json字符串
var jsonString = Ext.decode(response.responseText).jsonString;
var list = Ext.decode(jsonString);
if(list.length>0){
var htmlStr='<table id="messageTable">';
for(var i=0;i<list.length;i++){
htmlStr+='<tr id="message_'+list[i].messageId+'">';
htmlStr+='<td><a href="javascript:goToAskList('+list[i].messageId+');" style="color: #2e86b6; text-decoration: none">'+list[i].messageTitle+'</a></td></tr>';
}
htmlStr+='</table>';
if (tipWin) {
tipWin.update('<center>'+htmlStr+'</center>');//面板存在就更新面板里面的提示消息
}else{
tipWin = Ext.create('oa.ux.Notice', { //创建消息面板
title : '消息',
width : 190,
height : 100,
stickWhileHover: true,
autoScroll: true,
html: '<center>'+htmlStr+'</center>'
});
}
tipWin.show();
}else{
if (tipWin) {
tipWin.hide();
}
}
},
failure : function(response, options) {
}
});
}
需要注意的是 因为在ext 中所以首先要把js引入进来,一般是这种方式
requires : [
'oa.ux.Vtype',
'oa.ux.Notice', //需要引入的js 原名叫做Notification.js
'oa.util.Power',
'oa.util.DES3',
'oa.util.Encrypt',
'oa.CommonAndLoadFirst', // 最先加
使用的时候也要用这种方式
相关文章推荐
- 最近根据别人提示的一个想法,东拼西凑,终于实现了android系统中只能看到自己的系统,我称之为唯一系统。 很多企业做设备或是做产品的或是集成商 其中的一部分设备直接用android智能机。担是又不让
- 最近遇到一个非常棘手的需求是关于邮件转发的问题,请大家来帮忙给出出主意如何实现。
- 最近在玩android,突然想做一个私人聊天工具,缺乏一个服务器,于是自己想写一个c实现的daemon select server
- 最近遇到的一个关于iOS屏幕旋转的坑,而且还是自己无意中挖的
- 扔掉log4j、log4j2,自己动手实现一个多功能日志记录框架,包含文件,数据库日志写入,实测5W+/秒日志文件写入,2W+/秒数据库日志写入,虽然它现在还没有logback那么强大
- 自己动手实现一个 Flex 布局框架
- 一个自己实现的rpc框架
- 系统原型结构描述(概述)最近要设计一个框架,大家一起讨论下如何实现?
- 最近项目中有遇到报表数据入库的情况,数据量说大不大,说小又赖得自己手动敲!于是自己动手写了一个入库的,下面直接上代码,如有同样的,请联系我删除此文
- Select 可编辑 - 完美支持各大主流浏览器 最近做项目有个select可编辑的需求,一时棘手,网上找了很多解决方案都不完美,没办法自己写了一个,经测试IE,FF,chrome都支持。特此拿出来
- 自己动手设计并实现一个linux嵌入式UI框架
- 自己实现的一个寻径算法的框架,具体算法采用动态库模式,可以非常方便灵活地尝试多种寻径算法
- [JAVA]集合框架之自己实现一个具有基本增查删改功能的ArrayList
- 自己实现的一个Cache 使用最近常使用算法
- 自己实现的一个寻径算法的框架,具体算法采用动态库模式,可以非常方便灵活地尝试多种寻径算法
- 最近遇到的需求实现资料。转
- 实现一个简易的IoC框架(上)(此篇与Spring.NET无关,为自己手写IoC框架)
- 自己实现一个IOC框架
- 自己动手写一个web框架(一):实现IOC与MVC
- 源码分析之动手实现手写一个自己的SpringMVC框架(三)