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

Treeview events with angularjs

Hi.

How i can use treeview events with angularjs? any example?

Thanks.

1 Reply

KC Kasithangam C Syncfusion Team February 25, 2015 10:05 AM UTC

Hi Carlos,

Thanks for using Syncfusion Products,

How can I use treeview events with angularjs? Can you give an examples.

We would like to let you know that, in angular binding all the properties and events which is used in our controls are prefixed with the “e-“. So, we need to define the treeview events with “e“.For example, “create” and “nodeCheck” events of treeview control as “e-create” and “e-nodeCheck” respectively. Please find the below code for the same,

<div id="treeView" ej-treeview e-create="create" e-nodecheck="check" />

Similarly, you can use all the events of treeview control by adding the prefix “e-” before the event name in angular binding.

And we need to trigger the event within the scope in the script section as shown below code,

<script>

                        angular.module('treeApp', ['ejangular']).controller('TreeCtrl', function ($scope){

               $scope.create = function () {

                                         console.log("create event");

               };

               $scope.check = function () {

                                         console.log("nodeCheck event");

                               };

                        });

</script>

Also, we have prepared the sample based on this and you can find the sample under the following location,

Sample Location: Treeview event Sample

 To know more details about all the properties, methods and events information of all the component including treeview component in the below API link,

http://help.syncfusion.com/cr/js

 

Kindly let us know if you have further queries.

 

Regards,

Kasithangam



Loader.
Up arrow icon