howto 0.8.8c jstree click & double click

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Imperial
Posts: 6
Joined: Wed Jan 12, 2011 9:22 am
Location: Vienna - Austria

howto 0.8.8c jstree click & double click

Post by Imperial »

Hi!

on default there was only one way to open a child node, click on the tiny arrow left of the folder symbol
tree1.jpg
tree1.jpg (12.48 KiB) Viewed 1011 times
there was a double.click feature in the 3.1.1 jstree Version, downloadable from the jstree website (http://www.jstree.com/)

vakata-jstree-3.1.1-0-g5bece58.zip ->
vakata-jstree-3.1.1-0-g5bece58\vakata-jstree-5bece58\dist\jstree.js
rename the original jstree.js (...\include\js\jstree.js) into else jstree.js.bak and put the vakata-jstree-3.1.1-0... into the directory

thats all, double click feature is enabled, ok and now... single click...

edit the 3.1.1 jstree.js Version
goto Row 444 and set true to false

Code: Select all

				dblclick_toggle : true
goto Row 603-607, this should be there:

Code: Select all

				.on("dblclick.jstree", ".jstree-anchor", $.proxy(function (e) {
						if(this.settings.core.dblclick_toggle) {
							this.toggle_node(e.target);
						}
					}, this))
after them insert these lines:

Code: Select all

				.on("click.jstree", ".jstree-anchor", $.proxy(function (e) {
							this.toggle_node(e.target);
					}, this))
Now you can single click on a Node and it opens! :D

or even easier.. here my jstree.js file
jstree.zip
(52.74 KiB) Downloaded 69 times
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests