WidgetEventHandler
Namespace: Wisej.Web.Ext.Ignite
Assembly: Wisej.Web.Ext.Ignite (4.1.0.0)
Represents a JavaScript handler attached to an event fired by the third party widget.
- C#
- VB.NET
public class WidgetEventHandler
Public Class WidgetEventHandler
The handler runs in the browser. It receives the event object in the e argument; any additional argument passed by the third party widget, i.e. the ui object of the Ignite UI events, is available in arguments.
Use e.container to refer to the wisej.web.Widget instance, and e.container.widget to refer to the third party widget. Call e.container.fireWidgetEvent(name, data) to fire the WidgetEvent event on the server.
This class is not related to the WidgetEventHandler delegate, which is used to handle widget events on the server.
Constructors
WidgetEventHandler()
Initializes a new instance of WidgetEventHandler.
Properties
Name
String: Returns or sets the name of the event to handle. (Default: "")
The name must match the name of an event of the Ignite UI widget, i.e. "valueChange".
Source
String: Returns or sets the JavaScript source code of the WidgetEventHandler.
The value is the body of the handler function, without the function declaration. The event object is available in the e argument.
Example:
The following example handles the valueChange event of the rating widget and sends the new value to the server.
var handler = new igBase.WidgetEventHandler
{
Name = "valueChange",
Source = "e.container.fireWidgetEvent('rated', { value: arguments[1].value });"
};
this.igRating1.WidgetEvents = new[] { handler };