:: Documentation >>

setEvent

Assigns the HTML event handler.

null

Syntax

obj.setEvent(name, value);

Parameters

name (string) - event name
value (string or function) - event handler function

Example

obj.setEvent("onclick", myClickHandler);

Remarks

It is possible to pass a literal javascript code (string) as the value parameter. In this case the code will be simply put into the html attribute -

obj.setEvent("onclick", "alert(this.id)");

It will produce -

<div id="aw123" onclick="alert(this.id)" >...</div>

But more often the value parameter is an event handler function.

obj.setEvent("onclick", function(event){...});

In this case AW will catch the event, find the original AW object and call the event handler as a method of this object with the event as an argument.

See also

getEvent() method

Comments

multiple events rodrigo talento (6)
Are there guidelines for grid event management? Anthony (2)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5