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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Trying to set loadOnDemand to false to use getNode method (solved)

Thread ID:

Created:

Updated:

Platform:

Replies:

141592 Dec 19,2018 03:32 PM UTC Jan 11,2019 05:52 AM UTC Angular - EJ 2 8
loading
Tags: Treeview
Jon Andoni
Asked On December 19, 2018 03:47 PM UTC

Hello, 

My code is attached. Version 16.4.42 of syncfusion/ej2-angular-navigations is working in this project. The problem is even if I do getNode() with 'RN_Nicaragua' or with incoming id always returns empty node.

Any solutions?

Also, when I set loadOnDemand to false and clicked on a node, there is a lag between the click and the expansion. This makes expansion performance worse than when loadOndDemand is setted to true. 

Any solutions?

Attachment: codigopng_9829cc72.7z

Christopher Issac Sunder K [Syncfusion]
Replied On December 20, 2018 12:35 PM UTC

Hi Jon Andoni, 

Thank you for contacting Syncfusion support. 

We have checked your reported problem. We suspect that, you have tried to get the node which is not rendered. If you want get to particular tree node data(binded treeview format , not treeview data structure). You can use the getTreeData method to get the corresponding details. For this scenario, don’t need to disable loadOnDemand concepts.  
 
 

Please let us know if you require any further assistance. 

Thanks,
Christo


Jon Andoni
Replied On December 20, 2018 01:49 PM UTC

Hello Christopher,

The thing is that the node "RN_Nicaragua" is expanded on the tree when it is created, so it is rendered. As I wrote, my problem is that even I set loadOnDemand to false (I mean that the complete tree is rendered with this order) when apply getNode() method to the tree always return  empty node, in your example if I set loadOnDemand to false and I try to getNode of a "not rendered" node it returns me the node value. I don´t understand. Refering to getTreeData or updateNode, both works fine.

In this url you can see the behaviour of the code, is a video: 
https://drive.google.com/file/d/1dmHYVHjCeIucRW33jGxTzUa_QhVlThvr/view?usp=sharing

I attach the changes on the code in the next message.

Bye.

Jon Andoni
Replied On December 20, 2018 01:50 PM UTC

Here the changes on the code.

Bye.

Attachment: onNodeClickCode_3aaa09e7.7z

Christopher Issac Sunder K [Syncfusion]
Replied On December 21, 2018 07:25 AM UTC

Hi Jon Andoni, 

We have tried hard to identify your cause of your reported problem, but unfortunately we were unable to find it. Because we were able to get the clicked Node Li element id in nodeClicked event and based on this li element to form the data in getNode method of TreeView. Could you please try the below modified code block in your application?  
   
public onNodeClick(e){ 
    let currLi = e.node; 
    //pass the li element not id 
    console.log(this.treeview.getNode(currLi)); 
} 

Please let us know if you are still facing the issue so that we can create a support incident in DirectTrac to track the problem. 

Thanks,
Christo


Jon Andoni
Replied On January 9, 2019 01:38 PM UTC

Hello Christo,

We probe the solution but doens´t work, still facing the issue.

Thanks.

Christopher Issac Sunder K [Syncfusion]
Replied On January 10, 2019 11:28 AM UTC

Hi Jon Andoni, 

We checked your reported issue in your mentioned scenarios and other possible scenarios available but unfortunately, we were unable to reproduce the case at our end. We were able to get the corresponding clicked node details on nodeClicked event arguments and passing corresponding node id or node element to getNode method could get the needed details. 
So, could you please once ensure if the tree node id for which you are trying to get the node details is present in the corresponding Tree element. If you are still facing this issue could you please reproduce it for us in this sample. 

Note: You need not use refresh method in your code as TreeView is refreshed on binding the fields property to it. 

Please let us know if you have any concerns. 

Thanks, 


Jon Andoni
Replied On January 10, 2019 12:43 PM UTC

Hi Christopher, 
It works! After removing the treeView.refresh() getNode() method works!
Thank you very much!

Christopher Issac Sunder K [Syncfusion]
Replied On January 11, 2019 05:52 AM UTC

Hi Jon Andoni, 

We are glad to hear that the problem has been resolved. Please let us know if you require any further assistance. 

Thanks,
Christo 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon