Seidr
unread,Dec 10, 2009, 4:02:45 AM12/10/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mootree
Out of neccesity, I've written a quick function that retrieves a comma-
delimited list of text values, leading down to your currently selected
item in the tree. You can modify this to return objects in an array
instead, so that all data is available, however for my heads the text
will suffice. Hope someone finds this useful.
Add this to the MooTreeControl class.
/*
Property: crumbtrail
Returns the current crumbtrail of the selected node
*/
crumbtrail: function() {
var crumbtrailString = "";
if (this.selected) {
var currentItem = this.selected;
while (currentItem.parent) {
crumbtrailString = (crumbtrailString=="")?
currentItem.text:currentItem.text+","+crumbtrailString;
currentItem=currentItem.parent;
}
}
return crumbtrailString;
}