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.

Click / Select treeview node also checks the Checkbox

Thread ID:

Created:

Updated:

Platform:

Replies:

119101 May 11,2015 03:25 AM May 12,2015 05:58 AM JavaScript 1
loading
Tags: ejTreeView
Rob ONeill
Asked On May 11, 2015 03:25 AM

Hi,
Is it possible that when selecting / clicking on a treeview node that this action would also check the  Checkbox when showcheckbox is equal to true.

Cheers ... Rob.

Sasikala Nagarajan [Syncfusion]
Replied On May 12, 2015 05:58 AM

Hi Robert,

Thanks for using Syncfusion products,

We have analyzed your requirement and we have achieved this by customizing the treeview functionalities in node click event.

Please refer the below code snippet

<script type="text/javascript">

var treeObj;

$(function () {

$("#treeView").ejTreeView({ expandOn:"",showCheckbox: true,nodeClick:"selectCheckBox"});

treeObj= $("#treeView").ejTreeView('instance');

});


function selectCheckBox(args) {

if(args.currentElement.nodeName=="A") {

var element=$(args.currentElement).parents("li.e-item")[0];

isChecked=$("#treeView").ejTreeView("isNodeChecked",element);

!isChecked ? treeObj.checkNode(element):treeObj.uncheckNode(element);

}

}

</script>


In this we have disabled the “expand and collapse in double click” by setting “expandOn” as empty string (“”).


For your convenience we have prepared the simple sample based on this it can be downloaded from below location.

Sample,

Please check with the given sample and let us know if you have further queries.

Regards,

Sasikala Nagarajan


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.

;