日期:2014-05-17 浏览次数:20844 次
List<DeptCode> list = new ArrayList<DeptCode>();
DeptCode root = new DeptCode();
root.setContent("安居区");
root.setDept_code("A");
root.setParent("ROOT");
list.add(root);
DeptCode zhen = new DeptCode();
zhen.setContent("安居镇卫生院");
zhen.setDept_code("A1");
zhen.setParent("A");
list.add(zhen);
DeptCode wss1 = new DeptCode();
wss1.setContent("卫生室1");
wss1.setDept_code("A11");
wss1.setParent("A1");
list.add(wss1);
DeptCode wss2 = new DeptCode();
wss2.setContent("卫生室2");
wss2.setDept_code("A12");
wss2.setParent("A1");
list.add(wss2);
var json = {
id : "A",
name : "安居区",
children : [ {
id : "node13",
name : "安居镇卫生院",
children : [ {
id : "node24",
name : "安居卫生室1"
}, {
id : "node222",
name : "安居卫生室2"
} ]
}, {
id : "node125",
name : "白马镇卫生院",
children : [ {
id : "node226",
name : "白马镇卫生室1"
}, {
id : "node237",
name : "白马镇卫生室2"
}, {
id : "node258",
name : "白马镇卫生室3"
} ]
}]};