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) {
}
});
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', // 最先加
使用的时候也要用这种方式