| Issue 271: | Ability to add custom data to nodes | |
| 1 person starred this issue and may be notified of changes. | Back to list |
It would be nice, to be able to append custom data to nodes like it is possible with .data() method in jQuery. That would make it much easier to store meta information needed for your web application instead of having to generate a parallel data structure that has to be managed manually to achieve that. Because this isn't possible yet, it causes many problems to preserve consitency between both meta data and the node structure.
Oct 6, 2013
Closing 'Waiting' issues without timely answer
Status:
Done
May 2, 2014
Cleanup Scrumboard
Labels:
Milestone-Release2.0
Jun 17, 2014
Here's a use case: I have a dynatree list of pages in a hierarchy. I've added a right-click menu plugin to add some options like editing or deleting the pages, and need the context menu to be able to figure out the page id of the element I clicked on. I need to add a pageid attribute to each of the elements in the dynatree to be able to do this. I'm initializing the tree with the children array, so this needs to be defined from there and not using node.data.someattribute or whatever.
Jun 25, 2014
Custom properties that you add to the children array will be copied to node.data.xxx |
Can you give a use case? Would it help to simply add your data to `node.data`?, e.g. node.data.foo = "bar";