Skip to content

Custom directive for double click event on the tree elements #118

@shiv12095

Description

@shiv12095

I am trying to implement double click functionality on the leaf node elements of the tree. I have created a custom directive like this.

var app = angular.module("app", []);
app.directive("jstreeLeaf", function jstreeLeafDirective(){
  var directive = {
    restrict: "C",
    link: function link(elem, attrs) {
      elem.bind("dblclick", function() {
        console.log("Double click event");
      });
    }
  return directive;
});

However this fails to register the double click events on the leaf nodes since the tree is created after angular compiles the html.

Is there a way to recompile the tree so that my custom directive can work on the nodes?

Alternatively, is there another way that I can use to implement double click functionality ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions