Reputation: 2270
This is the data format for my nodes:
{
data: "new Structure",
attr: {id:"1", class:"structureNode", rel:"root"}
}
I have a reference for the node in question, and I can easily get the attributes
nodeReference.attr('attributeName')
However, I can't get access to the node name, stored in "data". Is there any way to get access to this while having a node reference (other than searching through the DOM to find the text in the <a>
field, which I find very cumbersome)?
I've considered storing the name in the attr array as well, but I don't like to have redundancy.
Thanks :-)
Upvotes: 3
Views: 5212
Reputation: 2270
I found the solution in the documentation. Apparently, all you need is .get_text(nodeReference)
:-)
Upvotes: 4