In an attached event handler, I have the “this” object that is the tree object. The handler function is going to send a transaction to my server and I need to pass the tree name that was used to create the tree. Is there a way to get the tree name from the tree object?
Thank you, in advance,
Dan Clarizio
Did you meant the name of tree container or tree object ?
In the former case, you may use this.parentObject.id. And there can be several ways in the later case:
- to assign some property to the tree object when it is initialized:
[code]tree1.customName = “tree1”;
function doOnClick(id){
var name = this.customName;
}[/code]
- you may check whether this is equal to a certain object:
function doOnClick(id){
if(this == tree1){
...
}
else if(this == tree2){
...
}
}
Thank you SO much . . . setting my own variable with the tree name in the tree object works great, I didn’t know I could do that.
Thanks again, Dan