Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSTree: Make node expand when single clicked instead of double click?

Tags:

jstree

I can't figure this out for the life of me but I am trying to configure my JSTree to override the double click event so it is just single click event. Is this something added to the callback configuration? I am not sure how to do this, will I need to edit the JSTree source code? Documentation here: http://docs.planbleu.org/modules/webportal/jquery/jsTree.v.0.9.5/documentation/#configuration

I tried changing the "ondblclk" to "click" in the source code and then adding a "click" callback option to the config settings and it did nothing... I am probably doing it wrong though.

like image 477
MetaGuru Avatar asked Jan 04 '11 19:01

MetaGuru


1 Answers

sending this into the tree creation function did the trick:

   onselect: function(n, t) {
         t.toggle_branch(n);
    },

(where t is the reference to the tree)

like image 168
MetaGuru Avatar answered Oct 07 '22 01:10

MetaGuru