87,976
社区成员
发帖
与我相关
我的任务
分享
function initGrid(){
$('#tt').datagrid({
url:'${ctx}/message/getMessagePage',
idField : "id",
pagination:true,
rownumbers : true,
fitColumns : true,
collapsible : true,
autoRowHeight : true,
loadMsg : "数据加载中,请稍等...",
frozenColumns : [[{field : 'ck',checkbox : true}]],
columns:[[
{title:'消息标题', field:'title',width:50,align:'center'},
{title:'消息文本内容', field:'description',width:50,align:'center'},
{title:'图片URL', field:'url',width:50,align:'center'},
{title:'消息类型', field:'messageTypeId',width:50,align:'center',formatter: function(value,row,index){
if (row.messageType){return row.messageType.name;}
else {return value;}
}},
{title:'发布人', field:'publisher',width:50,align:'center'},
{title:'发布时间', field:'createDate',width:50,align:'center',formatter:function(value){
if(value)return $.formatDate(value);
}},
{title:'更新时间', field:'updateDate',width:50,align:'center',formatter:function(value){
if(value)return $.formatDate(value);
}}
]], onClickRow:function (rowData){
var chks = $('#tt').datagrid('getChecked');
if(null!=chks && chks.length==1){
msgTyp = chks[0].messageTypeId;//获取到当前行消息的类型(主动推送或客户端拉取)
alert(msgTyp );
//根据消息类型显示或隐藏推送按钮
/* if(type=='推送消息'){
$("#pushMessage").show();
}else{
$("#pushMessage").hide();
} */
};
},
});
}
{
"total": 1,
"pageSize": 10,
"pageNumber": 1,
"rows": [
{
"id": 21,
"messageType": {
"id": 6,
"name": "通知消息",
"description": "充值信息通知",
"isDel": null,
"createDate": null,
"updateDate": null,
"reserved1": null,
"reserved2": null,
"page": null
},
"title": " 测试",
"publisher": "管理员C",
"description": "测试消息",
"url": null,
"sort": null,
"isDel": null,
"createDate": 1416922656000,
"updateDate": null,
"reserved1": null,
"reserved2": null,
"page": null
}
]
}