How do I pass custom variables to javascript events?

Posted by RoboShop on Stack Overflow See other posts from Stack Overflow or by RoboShop
Published on 2010-05-26T23:26:19Z Indexed on 2010/05/26 23:31 UTC
Read the original article Hit count: 296

Filed under:
|
|
|

I have a user control with a javascript function which references some controls within the user control.

This user control works perfectly when there is only one instance of it, but I'm now building a page where I have two instances of the user control.

In IE7, it works fine, but in FireFox, it is getting confused that there is two functions of the exact same name and signature. So on UserControl1, it'll be running the function in UserControl2 and modifying that content.

I'm thinking my best solution would be to pass the clientID of the components I need TO the function instead of just directly referencing it in the function.

How would I do that?

The signature of the javascript function is like this

function nodeClicking(sender, args)

and I'm calling it in an event like this

 <telerik:RadTreeView runat="server" ID="OrgUnitTreeView" OnInit="TreeViewLoad" 
                    OnClientNodeClicking="**nodeClicking**" EnableViewState="true"
                    DataTextField = "OrganisationUnitName" DataValueField = "OrganisationUnitCode"
                    DataFieldParentID = "ParentOrganisationUnitCode" DataFieldID = "OrganisationUnitCode">

How do I add extra variables to the function signature.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about events