Hi
When using javascript tools of a hierarchical nature such as OrgChart (ejDiagram)
or ejTreeView abd the data is returned from a database query (in jSON format)
the chart or treeview are not displayed if the root object(s) hav a NULL entry
in the ParentId column.
For example if I paste the data directly into the page and remove the null ParentId
the OrgChart displays. Replace the null ParentID no Orgchart.
Code extract for treeview:
function DisplayTreeView(data) {
DBS$("#TreeView").ejTreeView({
showCheckBox: true,
fields: { id: "Id", parentId: "ParentId", text: "EntityName", hasChild: "HasChild", expanded: "Expanded", dataSource: data }
});
}
Sample Data:
Root Object
EntityName:"Early Childhood & Sch Ed Group"
Expanded:1
HasChild:1
Id:1
ParentId:null
Child Object
EntityName:"Reform Implementation"
Expanded:0
HasChild:1
Id:101
ParentId:31
Regards
Gary