jQuery MiniUI
标题:
Tree列表层级自动解析
[打印本页]
作者:
cy1990
时间:
2012-12-2 15:50:09
标题:
Tree列表层级自动解析
你好,在实际应用数据中,发现有些层级是可以正常解析的,有些却不行,不知是何原因。
tree1.txt与tree2.txt格式完全一样,只是pid不同。
测试数据附件:[attach]1028[/attach]
tree1.txt:数据可正常解析
[
{
"leve": "comp",
"id": "2552E7BF-224E-4608-8EE2-816D0B0FAB3A",
"pid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3",
"caption": "三分公司",
"code": "1852600300",
"OrderID": 109,
"compid": "2552E7BF-224E-4608-8EE2-816D0B0FAB3A",
"groupid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3"
},
{
"leve": "dept",
"id": "fe40f3dd-1dcc-47e6-9897-8e7048d93f29",
"pid": "2552E7BF-224E-4608-8EE2-816D0B0FAB3A",
"caption": "基层领导",
"code": "3000",
"OrderID": 10001,
"compid": "2552E7BF-224E-4608-8EE2-816D0B0FAB3A",
"groupid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3"
},
{
"leve": "dept",
"id": "29a1b792-ca7d-44cb-aaf0-451b11e88b6f",
"pid": "2552E7BF-224E-4608-8EE2-816D0B0FAB3A",
"caption": "综合办公室",
"code": "320A",
"OrderID": 10002,
"compid": "2552E7BF-224E-4608-8EE2-816D0B0FAB3A",
"groupid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3"
}
]
复制代码
[attach]1026[/attach]
tree2.txt:无法解析层级
[
{
"leve": "comp",
"id": "31413139-14e7-4f74-9b75-8996bfbd956b",
"pid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3",
"caption": "三分公司",
"code": "1852600300",
"OrderID": 109,
"compid": "31413139-14E7-4F74-9B75-8996BFBD956B",
"groupid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3"
},
{
"leve": "dept",
"id": "fe40f3dd-1dcc-47e6-9897-8e7048d93f29",
"pid": "31413139-14E7-4F74-9B75-8996BFBD956B",
"caption": "基层领导",
"code": "3000",
"OrderID": 10001,
"compid": "31413139-14E7-4F74-9B75-8996BFBD956B",
"groupid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3"
},
{
"leve": "dept",
"id": "29a1b792-ca7d-44cb-aaf0-451b11e88b6f",
"pid": "31413139-14E7-4F74-9B75-8996BFBD956B",
"caption": "综合办公室",
"code": "320A",
"OrderID": 10002,
"compid": "31413139-14E7-4F74-9B75-8996BFBD956B",
"groupid": "01A1AD7C-27E2-48DC-A257-B82F9D07D3C3"
}
]
复制代码
[attach]1027[/attach]
作者:
factory
时间:
2012-12-3 09:30:40
你的第二个数据里面,PID的英文是大写的,而父节点的ID里面的英文是小写的,导致PID与ID不等,所以层级展现不出来
作者:
cy1990
时间:
2012-12-3 10:53:25
factory 发表于 2012-12-3 09:30
你的第二个数据里面,PID的英文是大写的,而父节点的ID里面的英文是小写的,导致PID与ID不等,所以层级展现 ...
好的,谢谢你,数据查询出来是对的,通过Newtonsoft.Json.dll格式化后,大小写不一致,主要是数据类型不相符.
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2