【发布时间】:2013-11-08 03:13:53
【问题描述】:
我有一个表“BinaryTree”,它有 2 列“CustomerID”和“ParentID”。
另一个表是“客户”,它有“客户ID”和“名字”列。
我想从这些表中查询数据,并希望将这些数据以Json格式分配给Spacetree。
请参考以下链接:-
http://philogb.github.io/jit/static/v20/Jit/Examples/Spacetree/example1.code.html
http://philogb.github.io/jit/static/v20/Jit/Examples/Spacetree/example1.html
我想要如下数据:-
Parentid CustomerID FirstName
1 34 Test1
1 64 Test2
1 46 Test3
34 45 Test4
34 102 Test5
64 22 Test6
46 54 Test7
所以我可以构建 json 字符串并将其分配给 spacetree。 如果它按顺序返回数据我会很好,这意味着对于 parentid 它首先返回其所有孩子。
然后它会一一返回这些子节点的子节点,因此很容易以 spacetree 所需的正确格式构建 json 字符串。
如果需要更多信息,请告诉我。
提前谢谢各位。
【问题讨论】:
标签: sql-server infovis thejit space-tree