LEADTOOLS JavaScript (Leadtools)

AddToEvent Method

Show in webframe
Example 
Object containing the event.
String containing the event name.
Event handler method.
Adds a handler to an event.
Syntax
 function Leadtools.LeadEventArgs.addToEvent( 
   target ,
   eventName ,
   method 
)

Parameters

ParameterTypeDescription
targetobjectObject containing the event.
eventNamestringString containing the event name.
methodDelegateEvent handler method.
Remarks

To remove the handler from the event, use RemoveFromEvent.

Example

This example adds a handler to the ImageChanged event of LEADTOOLS ImageViewer and then removes it.

example: function SiteLibrary_DefaultPage$example(viewer) {
   // The method to call on image changed
   var imageChangedHandler = null;

   imageChangedHandler = function(sender, e) {
      alert("Image has changed");
      // Remove the event
      lt.LeadEventArgs.removeFromEvent(viewer, "imageChanged", imageChangedHandler);
   };

   // Add a handler to the viewer.ImageChanged event
   lt.LeadEventArgs.addToEvent(viewer, "imageChanged", imageChangedHandler);

   // Set an image into the viewer and notice our alert
   viewer.set_imageUrl("Images/24.png");
},
See Also

Reference

LeadEventArgs Object
LeadEventArgs Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.