前台:
$("#grid").datagrid({
fit : true,
border : true,
rownumbers : true,
striped : true,
toolbar : [ {
id : 'diaodu',
text : '人工调度',
iconCls : 'icon-edit',
handler : function() {
// 弹出窗口
$("#diaoduWindow").window('open');
}
} ],
url : "${pageContext.request.contextPath}/notice_listNoStaffNoticeBill.action",
columns : [ [ {
field : 'id',
title : '编号',
width : 100
}, {
field : 'delegater',
title : '联系人',
width : 100
}, {
field : 'telephone',
title : '电话',
width : 100
}, {
field : 'pickaddress',
title : '取件地址',
width : 100
}, {
field : 'product',
title : '商品名称',
width : 100
}, {
field : 'pickdate',
title : '取件日期',
width : 100,
formatter : function(data, row, index) {
return data.replace("T", " ");
}
} ] ]
});
后台:
public String listNoStaffNoticeBill() throws IOException{
List<Noticebill> list = noticeService.findNoStaffNoticeBill();
String[] excludes = new String[]{"workbills","user","staff","customerId",
"customerName","arrivecity","num","weight","volume","remark","ordertype"};
this.writeList2Json(list, excludes);
return null;
}
通过开发者工具可以看到响应回来的数据
响应载荷哪里是
[{"delegater":"Lucy","id":"4028854f61c03bc10161c0489afc0000","pickaddress":"容县中学","pickdate":{"date":1,"day":4,"hours":0,"minutes":0,"month":1,"nanos":0,"seconds":0,"time":1517414400000,"timezoneOffset":-480,"year":118},"product":"电脑","telephone":"1"}]