Board Logo

capturing events?
tipsy88 - 3/1/2006 at 04:45 PM

Hi, my company recently purchased the tigra tree pro and we would like to display a dropdown menu when a user clicked on the link in the tree. in our old tree before we switched to tigra we would process this by calling a particular js function that was fired by the onclick property of the link element. I have tried to replicate using the events in tigra, but the problems is the dropdown menu needs a reference to the onclick event o render the menu correctly. Is there a way to fire this custom defined function within an onclick in the tree being written from tigra? Or is there some other way i might be able to accomplish this?


tigra - 3/2/2006 at 03:45 AM

to intercept the click event on the tree item you can:
1. use onItemSelect event of tree or particular item
2. insert javascript:yourfunction() in the link section of the item

tipsy88 - 3/2/2006 at 08:27 PM

First, thanks for suggestions, I tired using both but i am still stuck. The following function has two important variable that required to be passed in.

function example(this, event, ...) where

this - is referencing the html element (dom object) from which the the function is firing from

event - is the actual javascript event that fired the function

My results were the following.

using javascript:example(this, event) , produces a null for the second parameter. Does anyone know of a way to send the "click" event? A second problem is that, the this reference to the target of the href, and not the anchor itself explicitly.

using the onItemSelect event, i see you can get the reference of the tree item, but that's not what i need. Is there anywhere to get a reference to the element from which the onItemSelect function was fired from? Also i'm unsure through this technique how i may be able to get a reference to the "click" event itselef.

tigra - 3/3/2006 at 12:32 AM

all the references can be obtained one way or another. it's the event reference that can be a problem. Most likely you'll need to customize the tree's code to get it done. If this is for PRO version submit the support ticket, if it is for free then you can do that yourself or submit the specification and we'll respond with the quote.

Back to forum: