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. Image for the cookie policy date
close icon

ejTreeview - nodeClick gets executed on exapand

I have a simple folder treeview which load just fine.  However when I go to expand a node, it fires the nodeClick event for some reason.  Here is a snippet of the code:

$("#foldertreeView").ejTreeView({
                enableAnimation: true,
                enablePersistence: false,
                fields: {
                    dataSource: e.result,
                    id: "FolderId",
                    parentId: "ParentFolderId",
                    text: "FolderName",
                    hasChild: "IsParent",
                    imageUrl: $Url.resolve("~/Content/icons/folder.png")
                },
                template: "#treeTemplate",
                nodeClick: function (e) {
                    console.log(e);
                }

I'm trying to allow the user to expand a folder and choose a child folder by selecting it. After selection, the user is able to navigate to that folder.  I'm using ASP.Net Core MVC FYI.

Thanks,

Derral

1 Reply

KR Keerthana Rajendran Syncfusion Team October 21, 2019 10:45 AM UTC

Hi Dedrick Wright, 
  
Good day to you. 
  
We have checked your reported problem and provided code block at our end. We suspect that you are expecting to do some actions while clicking the tree node and not during the click of expand icon. If so,  we suggest you to use nodeSelect event to achieve this requirement. Please check the below sample. 
  
  
Please check the sample and get back to us, if you require any further assistance on this. 
 
  
Regards, 
Keerthana. 


Loader.
Live Chat Icon For mobile
Up arrow icon