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.

Treeview getCheckedNodes() doesn't always return parent nodes...

Thread ID:

Created:

Updated:

Platform:

Replies:

128252 Jan 10,2017 05:51 PM Jan 11,2017 08:52 AM ASP.NET Web Forms 1
loading
Tags: TreeView
Marc Call
Asked On January 10, 2017 05:51 PM


When calling getCheckedNodes() with a fully selected treeview, all nodes are returned.


However if one of the children nodes is NOT selected (as seen below)


The top most node and its immediate child are NOT returned.
I assume this works as intended, but I need to get those top nodes returned.

How can I get all nodes returned that have a check mark or a square in them??

Ashokkumar Balasubramanian [Syncfusion]
Replied On January 11, 2017 08:52 AM

Hi Marc, 
  
We are unable to check the provided screenshot, since it is unclear. However, we can understand your requirement to retrieve the nodes which have checked and Indeterminate state. You can get only the checked nodes using the method "getCheckedNodes". To get both checked and Indeterminate node, please use the below code in your application instead of getCheckedNodes method. 

[Script] 
// TreeView control object creation  

var treeViewObj = $("#treeView").ejTreeView("instance"); 
// To get both checked and Indeterminate node 
 
var nodes = treeViewObj._liList.find('> div > .e-chkbox-wrap[aria-checked="mixed"],> div > .e-chkbox-wrap[aria-checked="true"]').closest('.e-item'); 

For your reference, we have prepared sample with your requirement, it can be downloaded from below location. 


Please let us know, if you require any further assistance. 

Regards, 
Ashokkumar B. 


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.

;