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

CloudMeta picture CloudMeta · Jan 4, 2011 · Viewed 8.6k times · Source

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.

Answer

CloudMeta picture CloudMeta · Jan 19, 2011

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)