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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Angularjs treeview click event

Thread ID:





129003 Feb 21,2017 08:05 AM UTC Feb 22,2017 09:56 AM UTC JavaScript 2
Tags: ejTreeView
Asked On February 21, 2017 08:05 AM UTC

Hi All,

How can I implement a click event in angularjs tree view? any example would be a huge help.

Thanks in advance.

Replied On February 21, 2017 08:20 AM UTC

I Just discover primitive ng-click will do.

Karthik Ravichandran [Syncfusion]
Replied On February 22, 2017 09:56 AM UTC

Hi Adrian, 
Thanks for contacting Syncfusion support. 
We have analyzed your query (“How can I implement a click event in angularjs tree view?”). We would like to inform you that, you can achieve your requirement using “nodeClick” event of ejTreeView 
Please refer the below code block. 
<div id="treeView" ej-treeview e-fields-datasource="dataList" e-fields-id="id" e-fields-parentid="pid" e-fields-text="name" e-fields-haschild="hasChild" e-fields-expanded="expanded" e-nodeclick="onClick" /> 
angular.module('syncApp', ['ejangular']) 
    .controller('TreeViewCtrl', function ($scope) { 
        $scope.dataList = phones; 
        $scope.onClick = function (args) { 
            if ($(args.currentElement).hasClass('e-text')) { 
                $scope.selectedvalue = args.currentElement.innerText; 
For your convenience, we have prepared the sample, please refer the below link 
To know more details about the nodeClick event in ejTreeView, please refer the below documentation link. 
Please let us know if you need further assistance on this. 
Karthik R 


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