layui表格中使用模板時需要注意
{field:'user',title: '出卷人', sort: true, templet:function(d){return '<div>'+d.user.username+'</div>'}}


在后台設置表格的json數據時,需要先把數據對象轉為Object類型,否則出現重復對象時會出現 $ref 導致數據為空
1 JSONObject jsonObject = new JSONObject(); 2 Object objData = JSONObject.toJSON(數據); 3 jsonObject.put("code", 0); 4 jsonObject.put("msg", ""); 5 jsonObject.put("count", p.size()); 6 jsonObject.put("data", objData); 7 response.getWriter().print(jsonObject.toString());
