Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shiv12095 opened this issue Jun 21, 2017 · 0 comments
Open

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

shiv12095 opened this issue Jun 21, 2017 · 0 comments

Comments

@shiv12095
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant