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

Unexpanded tree element doesn't get checked

Thread ID:

Created:

Updated:

Platform:

Replies:

142651 Feb 13,2019 10:58 AM UTC Feb 18,2019 12:08 PM UTC Angular - EJ 2 3
loading
Tags: Treeview
Domantas
Asked On February 13, 2019 10:58 AM UTC

Hello,

I'm using TreeView with checkboxes and on initial rendering I'm getting ID's from database and by those ID's I'm checking treeView items. But I found an issue, the tree node won't be marked as checked if it's not expanded before selectedNodes or .checkAll() apply.

Query: How to programmatically mark node as checked even if it is not expanded. 

I've reproduces issue in one of your demos:

Christopher Issac Sunder K [Syncfusion]
Replied On February 14, 2019 10:27 AM UTC

Hi Domantas, 

Thank you for contacting Syncfusion support. 

You can overcome the reported issue by setting 'loadOnDemand' property as false. We have prepare a sample for your reference.

 

For more information please refer the following documentation link 

We have also provided the option to check the non-expanded child node while enabling the loadOnDemand. This support will be available in our upcoming volume 1, 2019 release which is expected to be rolled out in the month of March, 2019. 

Please let us know if you require any further assistance. 

Thanks, 
Christo 


Domantas
Replied On February 15, 2019 07:54 AM UTC

Hello,

Thank you for your answer, it solved the issue.

I got one more question with TreeView. I do change autoCheck while being in action. And the problem is that if selected parent has no selected childs it will get unchecked.

Query 1: How do I maintain same selectedNodes before autoCheck and after autoCheck. For example if I still want parent to maintain selected and be in selectedNodes even if it has no selected child

Query 2: Can I somehow get rid of "mixed" status and leave just checked and unchecked


In example we got 2 parents selected, one parent has selected child another one doesn't.


This is what happens when I apply this.treeView.autoCheck = true. Parent that had selected child gets "mixed" status, but the one that didn't selected child gets unselected. And now selectedNodes before autoCheck and after autoCheck are different, but I only changed the property.


Prince Oliver [Syncfusion]
Replied On February 18, 2019 12:08 PM UTC

Hi Domantas, 

Thank you for your update. 

While enabling autoCheck option, the parent node will be in the checked state, only if all the child Nodes are checked. Otherwise it will be in mixed state, even if any one of its child items are not checked. This is the default behavior of TreeView when the autoCheck property is enabled. 

If you still want to maintain the parentNode in checked state, you need to push the parentNode into the checked node before enabling the autoCheck property. But this will select all the child nodes of specific parent node. 


Please check the above sample and let us know whether you need to achieve this behavior. Please let us know if you need any further assistance on this. 

Regards, 
Prince 


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