We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Data binding

Thread ID:

Created:

Updated:

Platform:

Replies:

124551 Jun 14,2016 02:52 AM Jun 15,2016 07:55 AM JavaScript 1
loading
Tags: ejTreeView
Gary Wadden
Asked On June 14, 2016 02:52 AM

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

Piramanayagam Ramakrishnan [Syncfusion]
Replied On June 15, 2016 07:55 AM

Hi Gary, 
 
Thanks for contacting Syncfusion support. 
 
Query1: The treeview is not displayed if the root object(s) has a NULL entry in the ParentId column. 
We are unable to reproduce the reported issue (“The TreeView is not displayed if the root object has null entry in ParentId column”) in TreeView control. TreeView is working properly with given code. 
 
For your reference we have prepared the sample to showcase that TreeView control is working properly with given code in the link: http://jsplayground.syncfusion.com/2a1k3ml4 
 
If you still face the same issue, kindly get back to us with more information or provide sample based on your application along with the replication procedure to reproduce the issue at our end. This would be helpful for us to identify the issue and provide a solution at the earliest.

 
Query2: The OrgChart is not displayed if the root object(s) has a NULL entry in the ParentId column.
Please confirm whether the OrgChart didn’t render, when you set root’s parentId as null. If so, we are unable to reproduce the reported issue at our end. Please check with the below playground link and let us know if you are facing any issues at your end.
 
 
Here is the playground link  
 
Regards,
Piramanayagam R.
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;