renderJson 返回的数据,部分数据存在null值

  "data": {
        "children": [
            {
                "children": [
                    {
                        "children": [
                            {
                                "children": [],
                                "count": 0,
                                "topic": "计算机、通信和其他电子设备制造业",
                                "id": "L139",
                                "direction": "left"
                            },
                            {
                                "children": [],
                                "count": 0,
                                "topic": "铁路、船舶、航空航天和其他运输设备制造业",
                                "id": "L137",
                                "direction": "left"
                            }
                        ],
                        "count": 0,
                        "topic": "金属制品、机械和设备修理业",
                        "id": "L143",
                        "direction": "left"
                    },
                    {
                        "children": [
                            {
                                "children": [
                                    {
                                        "children": [
                                            {
                                                "children": [
                                                    {
                                                        "children": [
                                                            {
                                                                "children": null,
                                                                "count": null,
                                                                "topic": null,
                                                                "id": null,
                                                                "direction": null
                                                            },
                                                            {
                                                                "children": null,
                                                                "count": null,
                                                                "topic": null,
                                                                "id": null,
                                                                "direction": null
                                                            },
                                                            {
                                                                "children": null,
                                                                "count": null,
                                                                "topic": null,
                                                                "id": null,
                                                                "direction": null
                                                            }
                                                        ],
                                                        "count": 0,
                                                        "topic": "基础化学原料制造",
                                                        "id": "L1261",
                                                        "direction": "left"
                                                    },
IndustryZtree industryZtree = new IndustryZtree();
industryZtree.setId("C" + middle);
industryZtree.setTopic(topic);
industryZtree.setChildren(list);
setAttr("data", industryZtree);
renderJson();

使用renderjson返回数据时部分数据会被搞成

 {
                                                                "children": null,
                                                                "count": null,
                                                                "topic": null,
                                                                "id": null,
                                                                "direction": null
                                                            }

请问是什么原因

评论区

Peter

2019-01-03 20:11

list里面 数据本身就是 null,数据库层面 处理一下 null

秘密坐在身旁

2019-01-09 15:26

@Peter 数据本身不是null当我使用renderText()返回数据时就好着,我怀疑是renderjson封装json数据出现问题了

热门分享

扫码入社