Sochettra / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

$.ui.dynatree.getNode(el) not working #275

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
when using $.ui.dynatree.getNode(el); it will return undefined

Original issue reported on code.google.com by muehl...@gmail.com on 20 Jan 2012 at 10:50

GoogleCodeExporter commented 8 years ago
It works alt least *sometimes*:
    http://wwwendt.de/tech/dynatree/doc/sample-contextmenu.html#
so could you provide some details please.

Original comment by moo...@wwwendt.de on 20 Jan 2012 at 6:01

GoogleCodeExporter commented 8 years ago
Hi,

I am having a simular problem with nodes which have been cloned with true to 
maintain events etc. When the cloned elements are pasted into the tree thay 
look and behave fine but when I call GetNode from within a custom context menus 
function triggered via a right click on one of the cloned nodes I am getting 
null in return. When I call addchild() instead of cloning the problem does not 
occur. If I discover the issue I will try to post it.

Original comment by adb...@hotmail.com on 17 Jul 2012 at 8:30

GoogleCodeExporter commented 8 years ago
Dynatree adds a reference to the node object as 'dtnode' attribute to the 
generated <li> tags.
(The tree and nodes are stored as separate data structure, that is rendered on 
demand).

clone seems to ignore this dtnode attribute, which is a good thing: otherwise 
you would have 2 DOM elements that reference the same DynaTreeNode instance.

Original comment by moo...@wwwendt.de on 18 Jul 2012 at 6:26

GoogleCodeExporter commented 8 years ago
Thank you for you quick reply and explination. I can see that it is a good 
thing to not have two visible tree nodes point to one internal dynatree entity. 
I guess my thinking is that later when I insert the clone into the tree a new 
internal entity would be created and the dtnode property of the clone would 
point to the new dynatree entity. In my case when I paste the clone, after the 
operator selects another node at the same level, I use var jObj = 
$(sElem).after(tmpHTML); where sElem is the .closest("LI") of the selected node 
and tmpHTML is the clones html which I have reworked a bit.
I want to thank you for all your efforts in providing an excellent jQuery 
treeview plugin. I want to give special thanks to the author who posted the 
example of how to do inline editing of a dynatree node. I adopted the example 
and converted it to display a select box for the inner most level of my tree. 
This is really slick as it gives so much versility to the treeview - Thanks Al

Original comment by adb...@hotmail.com on 18 Jul 2012 at 1:48

GoogleCodeExporter commented 8 years ago
Just a note. In the mix with all this I was trying to add a sibling node at the 
top level of my tree and I wanted it adjacent to the last top level node which 
was right clicked. This solved my problem. I had not previously seen the option 
on addchild to select the sibling till I looked at the code.

var dtnode = $.ui.dynatree.getNode(lastrightclickedelem);

var rootNode = $("#tree").dynatree("getRoot");

rootNode.addChild({title:"new title", icon: "my.ico"},dtnode);

Original comment by adb...@hotmail.com on 18 Jul 2012 at 3:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Please use with older version of jQuery like 1.4.2 and getNode should work 
again...

Original comment by shassa...@gmail.com on 26 Jul 2012 at 4:50

GoogleCodeExporter commented 8 years ago
The oldest jQuery version available for download is 1.6.3. Going backwards is 
really not an option given project policies. Is getNode fixed in the 
latest(1.2.4) version of dynatree? Will dynatree work with jQuery 1.9.1? All 
was fine till we went with jQuery 1.7.1 but there is no turning back.

Original comment by adb...@hotmail.com on 28 Mar 2013 at 12:57

GoogleCodeExporter commented 8 years ago
DT should work with the current releases of jQuery.
i am not aware of problems concerning getNode there. Please provide some 
details, if if it fails for you...

Original comment by moo...@wwwendt.de on 31 Mar 2013 at 3:41

GoogleCodeExporter commented 8 years ago
Closing 'Waiting' issues without timely answer

Original comment by moo...@wwwendt.de on 6 Oct 2013 at 2:09

GoogleCodeExporter commented 8 years ago
Cleanup Scrumboard

Original comment by moo...@wwwendt.de on 2 May 2014 at 7:47