OpenLink AJAX Toolkit (OAT) Wiki Web

  • Topic
  • Discussion
  • OATWikiWeb.OATDOCevents(Last) -- DAVWikiAdmin? , 2008-09-15 10:51:09 Edit WebDAV System Administrator 2008-09-15 09:51:09

    OATDOCevents

    Event handling basics

    Event handling is very simple in this toolkit. There are two routines that accomplish this:

    OAT.Event.attach(element, event, functionReference)

    First argument specifies an element which should detect the event. Second is the event (without the 'on' prefix). Last argument is a valid function reference, i.e., the name of an existing function or Anonymous function.

    Examples

    var div = OAT.Dom.create("div");
    OAT.Event.attach(div, "mouseover", function() { alert('Hi!'); });
    
    
    

    or

    OAT.Event.attach("some_id", "click", genericFunctionReference);
    
    
    

    OAT.Event.detach(element, event, functionReference)

    Use the same syntax as inOAT.Event.attach().: ThefunctionReferenceargument must exist in the current scope, so it is not possible to remove aneventhandled by anonymous function.

    Example

    OAT.Event.detach(element, "click", functionReference);
    
    
    

    CategoryDocumentation CategoryOAT CategoryOpenSource