楼主最近遇到一个需求就在在ext 框架里实现右下角弹框提示,就自己动手做了一个

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', // 最先加

使用的时候也要用这种方式

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值