大神帮看看啊,使用easyui中的datagrid请求后台数据已经响应了,页面上数据却显示不出来

纯洁的大白 2018-02-23 10:50:34
前台:
$("#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"}]
...全文
912 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
纯洁的大白 2018-02-23
  • 打赏
  • 举报
回复
好了,解决了,得到我想要的效果了,感谢大神的帮助
纯洁的大白 2018-02-23
  • 打赏
  • 举报
回复
真是耶,不过要返回一个正常的日期怎么弄?
  • 打赏
  • 举报
回复
pickdate的formatter有问题,pickdate是json对象,没有replace方法,出错了。自己想清楚pickdate要取{"date":1,"day":4,"hours":0,"minutes":0,"month":1,"nanos":0,"seconds":0,"time":1517414400000,"timezoneOffset":-480,"year":118}这个json对象里面的什么字段值 { field : 'pickdate', title : '取件日期', width : 100, formatter : function(data, row, index) { return data.year//返回年份,或者自己整 } }

Web开发学习资料推荐
easyui datagrid fitColumns:true失效解决办法
easyui datebox设置日期范围

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧