TreeGrid数据不显示,js也没有报错。不知道原因。
$('#test2').treegrid({
url: '../../PurSelectGoodsCTL/CalculatePlanInfo?calculate='+ss.toString(),
title: 'TreeGrid - ContextMenu',
width: 1200,
height: 500,
fitColumns: true,
rownumbers: true,
idField:'id',
treeField:'物料编码',
columns:[[
{field:'物料编码',title:'物料编码',width:80},
{field:'物料名称',title:'物料名称',width:120},
{field:'物料规格',title:'物料规格',width:120},
{field:'计量单位',title:'计量单位',width:30,align:'right'},
{field:'单位用量',title:'单位用量',width:30,align:'right'},
{field:'库存数量',title:'库存数量',width:30,align:'center'},
{field:'备注',title:'备注',width:60,align:'center'},
{field:'物料编码bom',title:'物料编码bom',width:60,align:'center'}
]]
});
这是后台发过来的数据
{"total":117,"rows":[
{"id":1,"code":"code1","name":"name1","addr":"address1"},
{"id":11,"code":"code11","name":"name11","addr":"address11","_parentId":1},
{"id":2,"code":"code2","name":"name2","addr":"address2","state":"closed"},
{"id":21,"code":"code21","name":"name21","addr":"address21","_parentId":2},
{"id":22,"code":"code22","name":"name22","addr":"address22","_parentId":2},
{"id":3,"code":"code3","name":"name3","addr":"address3","state":"closed"}
]}
JSONArray ja = JSONArray.fromObject(ls);
JSONObject jo=new JSONObject();
jo.put("total", ls.size());
jo.put("rows", ja);
System.out.println(jo.toString());
response.getWriter().write(jo.toString());
<span></span> <span></span>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。