Easyui treegrid加载没数据。。 15
返回的json格式{"row":[{"id":1,"col4":"col41","name":"name1","children"[{"id":11,"name":"na...
返回的json格式
{"row":[
{"id":1,"col4":"col41","name":"name1","children"[
{"id":11,"name":"name11","addr":"addr11","code":"code11","checked":true},{"id":12,"name":"name12","state":"closed","addr":"addr12","code":"code12"}
],"addr":"addr1","code":"code1","iconCls":"icon-ok"}]
} 展开
{"row":[
{"id":1,"col4":"col41","name":"name1","children"[
{"id":11,"name":"name11","addr":"addr11","code":"code11","checked":true},{"id":12,"name":"name12","state":"closed","addr":"addr12","code":"code12"}
],"addr":"addr1","code":"code1","iconCls":"icon-ok"}]
} 展开
2个回答
展开全部
返回的数据格式不对;
{"total":3,"rows":[{“name”:“布丁”,"age":"21"},{“name”:“小布丁”,"age":"21"},{“name”:“巧克力”,"age":"21"}]} 应该是这样的一个格式;你可以在本地var一个这样的对象;先加载本地的这个数据看看行不行;可以的话就在后台改改发挥的数据格式就好了!
{"total":3,"rows":[{“name”:“布丁”,"age":"21"},{“name”:“小布丁”,"age":"21"},{“name”:“巧克力”,"age":"21"}]} 应该是这样的一个格式;你可以在本地var一个这样的对象;先加载本地的这个数据看看行不行;可以的话就在后台改改发挥的数据格式就好了!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
treegrid后台返回的json数据当中需要parentId来标示那个是父节点,parentId等于子节点中的一个属性的值,子节点此属性值相同的则在同一个父节点之下。先将查到的数据放入list,然后再装入Map,map.put("rows", list);转化成json格式就可以了。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询