Board Logo

Cannot expand to a certain node on page load
rgravel70 - 10/30/2007 at 06:01 PM

Hi,

I'm having a hard time trying to expand to a certain node on page load. I use Tigra Tree Menu Pro 1.3.

Here's my code:

new tree (TREE_ITEMS, tree_tpl, "TheTree");
var o_tree = (TREES['TheTree']);
var a_item = o_tree.find_item_by_key('structureID',898);
for(var n=0; n < a_item.length; n++) {
o_item=a_item[n];

var n_id = o_item.n_id
var n_depth = o_item.n_depth
var a_index = o_item.o_root.a_index
var a_parents = [o_item];

while (n_depth) {
if (a_index[n_id].n_depth < n_depth) {
a_parents[a_parents.length] = a_index[n_id];
n_depth--;
}
n_id--;
}

for (var i = a_parents.length-1; i >= 0; i--) {
if (a_parents.n_state & 48) {
a_parents.open();
}
}

o_tree.select(a_item[0].n_id);
}

Everything seems to be fine until it comes to the line with "a_parents.n_state & 48". It keep saying "undefined".

What does 48 means? I found this example on SoftComplex site.

If, instead of looking for the key containing my index "898", I put "2", it works because it don't have to open subfolders.

What do I do wrong?

See my tree_items_e.js file attached.

Thanks

Robert


tigra - 10/31/2007 at 12:53 AM

there is a working sample for similar situation in the product documentation. consider using it instead.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/