Click / Select treeview node also checks the Checkbox
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.
SIGN IN To post a reply.
1 Reply
SN
Sasikala Nagarajan
Syncfusion Team
May 12, 2015 09:58 AM UTC
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.
For your convenience we have prepared the simple sample based on this it can be downloaded from below location.
Please check with the given sample and let us know if you have further queries.
Regards,
Sasikala Nagarajan
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
RO Rob ONeill
- May 11, 2015 07:25 AM UTC
- May 12, 2015 09:58 AM UTC
7/28/2026 06:18:06 AM
Sun, 15 December 2024 03:30:00 UTC
Sun, 15 December 2024 03:30:00 AM
Wed, 16 Feb 2022 04:59:00 UTC