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.

Hierarchical treeview with parent and child datasources

Thread ID:

Created:

Updated:

Platform:

Replies:

129705 Mar 29,2017 11:25 AM Apr 5,2017 08:20 AM JavaScript 3
loading
Tags: ejTreeView
Tomasz Bednarek
Asked On March 29, 2017 11:25 AM

Hi Syncfusion,

Would you please help me out with the ejTreeView control?
I'm trying to display a 2-level list of checkbox items with a separate datasource for parents and children.
I cannot get the children to be displayed. What am I doing wrong?


Thank you in advance,
Tomasz Bednarek

Karthik Ravichandran [Syncfusion]
Replied On March 30, 2017 08:09 AM

Hi Tomasz, 
 
Thanks for contacting Syncfusion support. 
 
You can achieve your requirement by processing your dataSource using ej.DataManager. Please refer the below code block. 
 
var therapeuticAreas1 = new ej.DataManager(therapeuticAreas); 
var projects1 = new ej.DataManager(projects); 
 
$("#treeView").ejTreeView({ 
    fields: { 
        dataSource: therapeuticAreas1, id: "id", text: "name", 
        child: { 
            dataSource: projects1, id: "id", parentId: "therapeuticAreaId", text: "name" 
        } 
    }, 
    allowMultiSelection: true, 
    showCheckbox: true, 
    fullRowSelect: true 
}); 
 
 
Based on your requirement we have modified your sample, please refer the below link. 
 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Karthik R 


Tomasz Bednarek
Replied On April 4, 2017 06:52 AM

Hi Karthik,

Thanks, it works. I think it would be a good idea to review and extend the documentation of the control, especially the fields section, because you have no chance of knowing the correct approach by reading the documentation.

Kind Regards,
Tomasz Bednarek

Karthik Ravichandran [Syncfusion]
Replied On April 5, 2017 08:20 AM

Hi Tomasz, 
 
Thanks for your update. 
 
We will consider this as an improvement in our side and we will improve our document in our upcoming releases. 
 
Please let us know if you have any concerns 
 
Regards, 
Karthik 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.

;