jannbmsy / dynatree

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

Get DOM node by ID from dynaTree Node #423

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I am using dynaTree 1.2.4 with jQuery 1.9. 

I need to get the the equivalent DOM/jQueryNode based on DOM Element's ID. I 
can see that dynaTree doesnt add any DOM id to the dynaTreeNode. Essentially, I 
want to do reverse of what this dynaTree API achieves :

$.ui.dynatree.getNode(<domElement identified by id>)

Is it possible to do so ?

Thanks
Binita

Original issue reported on code.google.com by binita.b...@gmail.com on 23 Apr 2013 at 11:03

GoogleCodeExporter commented 8 years ago
Are you looking for  the 'generateIds' option?

Original comment by moo...@wwwendt.de on 23 Apr 2013 at 1:23

GoogleCodeExporter commented 8 years ago
What I mean is that , the HTML associated to each dynaTreeNode should have a 
'id' associated. Currently, its putting all the attributes into the HTML "data" 
attribute. But, to uniquely identify a node in DOM/jQuery, a "id" attribute is 
required. 

I should be able to do something like :

in plain DOM :
        document.getElementById(<dynaTreeNode's Id>) 
 or its jQuery equivalent :
       $("<dynaTreeNode's Id>")

Not sure about the 'generateIds' option though.

Thanks

Original comment by binita.b...@gmail.com on 23 Apr 2013 at 2:48

GoogleCodeExporter commented 8 years ago
I think setting `generateIds: true` should solve it

Original comment by moo...@wwwendt.de on 23 Apr 2013 at 6:56

GoogleCodeExporter commented 8 years ago
Adding generateIds property to the treeNode didnt work :(. 

Original comment by binita.b...@gmail.com on 24 Apr 2013 at 10:13

GoogleCodeExporter commented 8 years ago
it's an option you can set when initializing the tree, you can search the docs 
for it...

Original comment by moo...@wwwendt.de on 24 Apr 2013 at 4:31

GoogleCodeExporter commented 8 years ago
Cleanup Scrumboard

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