Board Logo

Multiple events when Tree branch is selected
jsuen - 12/19/2006 at 04:37 PM

Hi,

I have bought the Pro version of the Tigra Tree Menus, and have managed to get it generating the tree hierarchy I need fairly easily.

My query now is that I'd like for branches that are selected to not only open up any child leaf nodes, but also to fire off another event (i.e. call a Javascript function).

When I override the OpenItemHandler per item, i.e. {'hs':'OnItemOpenHandler', 'link': 'http://www.google.com'} - this can only call the Javascript (and does not open the branch anymore).

Does anyone know of another way to add an event for a multiple chain?

Thanks,

Jon


jsuen - 12/19/2006 at 04:53 PM

For anyone who's interested, this is probably best done in the tree_tpl.js (or similar file):
'onItemOpen':'open_test', // on item open event handler
'onItemClose':'close_test', // on item close event handler

As mentioned in the documentation, you can pass a parameter (or call other Javascript functions) into your defined open_test or close_test methods:
function open_test (o_item) {
testAlert(o_item.a_config[2]['link']);
// here you can insert your item open event handler
return true;
}

Jon


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