Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Passing custom variable(s) into event handler
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 12/4/2003 at 09:11 PM
Passing custom variable(s) into event handler


As you probably know with Tigra Tree Menu PRO you can assign event handlers globally to all tree items or to some tree items.

When assigning the handler in template or items file you only specify the name of function. When called, this function will receive single parameter: tree item object reference. Now if you want to pass some more parameters to the handler (for example application specific item ID) you can use item scope settings array. Just specify some key not currently used by the script:

['Home', 'http://www.softcomplex.com/',{'ho':'OnItemOpenHandler', 'myID': 35}]

In handler function the value can be acessed via tree item object reference:

function OnItemOpenHandler (o_item) {
if (o_item.a_config[2] && o_item.a_config[2]['myID']) {
var n_myID = o_item.a_config[2]['myID'];
// now you've got the value
}
...
}

to make items structure more compact and easy maintainable you can assign handler globally to all items while in event handler perform action(s) only for those items that have particular parameter defined.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004