Get attached object reference

Dear all,

I am new to web programming and I have a question regarding object attaching to layout.
Imagine the following scenario:

/*accordion cell is a layout cell*/
var accordion_menu = accordion_cell.attachAccordion();
var accordion_partners = accordion_menu.addItem("acc_partners", lb_partners);
/*I am attaching a tree*/
var hierarchy_tree = accordion_partners.attachTree();

Lets say that accordion_partners is a global variable and I want to access hierarchy tree from another javascript function. How do I get a reference to the tree object. It seems that there is no function like

accordion_partners.getObject(mytreeObject) 

Am I missing something ?

Regards,
S.

Hello
Just one question: what are you going to do with this tree object?
Generally in your case tree object is “hierarchy_tree”

Dear Darya,

The variable hierarchy tree has a local scope. How can I access the tree from another JS function ?
Example:

function treeCreation(){
  var hierarchy_tree = accordion_partners.attachTree();
}

function doSomethingWithTheTree(){

  /*How do I get a tree reference here ?? */
   var my_tree = accordion_partners.get????
}

Do you see my point ?

Thanks,
S.

Do you mean DOM or DHTMLX object?

Since I am new to web to programming, I do not clearly understand what you are asking.
I want to handle my tree from another JS function. To the previous example, I want to be able to do something like :


function treeCreation(){
  var hierarchy_tree = accordion_partners.attachTree();
}

function doSomethingWithTheTree(){

  /*How do I get a handler for my tree ?? */
   var my_tree = accordion_partners.get????
    
   mytree.findItem("x"); /* find item is a dhtmlx tree method */
}

“hierarchy_tree” is your tree object.

hierarchy_tree is not a global variable hence it is not accessible through other JS function…

Unfortunatelly there is no such method to get it.
You can either make it global or set it as a property of another object that you can access from the function.