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. Image for the cookie policy date

Can not see TreeView after renew to version 16.4.45

Hello,

after renew @syncfusion/ej2-angular-navigations package to version 16.4.45 I can no longer see my treeView component. Data from WebAPI is getting correctly, component dataSource are filled, fields are set by my treeView do not show any data (in html ejs-treeview is rendered but with no data).

I am getting and setting data to my treeView like this: https://stackblitz.com/edit/angular-tvkh1s-ynnewh?file=remote-data.component.ts

I am getting remote data from WebAPI and adding it to dataSource as local data. After that I am setting fields. If I am not setting property parentId I can see data in example, but I want that my root data will be where parentId is null ant than child data will by added to root by pairing id and parentId fields (like it used to work with all previous versions and still working with version 16.4.44 but not working with version 16.4.45).

1 Reply

CI Christopher Issac Sunder K Syncfusion Team January 8, 2019 12:51 PM UTC

Hi AC, 

Thank you for contacting Syncfusion support. 

We have checked your provided sample and requirement at our end. For that, in our data service - https://services.odata.org/V4/Northwind/Northwind.svc , we do not have parent and child data in a single table. So, we are unable to showcase the parent and child nodes in your provided sample. For your reference, we have prepared a sample by storing data received from remote service and binding that data to our TreeView component. For this case, we could not reproduce your reported issue from our side. Could you please check the below code block and sample. 

remotedata.component.ts 

this.data = new DataManager({ 
      url: 'https://services.odata.org/V4/Northwind/Northwind.svc', 
      adaptor: new ODataV4Adaptor, 
      crossDomain: true, 
    }).executeQuery(new Query().from('Employees').select('EmployeeID,FirstName,Title').take(5)) 
      .then((e: any) => { 
        if (e.result[0] && e.result[0].HasErrors) { 
          console.error("Error occurred: ", e.result[0].ErrorCode) 
          return; 
        } 

        //sample data received from remote service 
        e.result =  [ 
        { "EmployeeID": 1, "FirstName": "John", "hasChildren": true, "expanded": true }, 
        { "EmployeeID": 2, "parentID": 1, "FirstName": "Stephen" }, 
        { "EmployeeID": 3, "parentID": 1, "FirstName": "Andrea" }, 
        { "EmployeeID": 4, "parentID": 1, "FirstName": "Jessy" } 
        ]; 
     
this.field = { dataSource: e.result, id: 'EmployeeID', text: 'FirstName', hasChildren: 'hasChildren', parentID: 'parentID', expanded: "expanded" } 
      }); 


Please check it and let us know if you have any more concerns. 

Thanks,
Christo 


Loader.
Live Chat Icon For mobile
Up arrow icon