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" /> [controller] 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.
Regards,
Karthik R