Skip to main content

WidgetEventHandler

Namespace: Wisej.Web.Ext.Syncfusion

Assembly: Wisej.Web.Ext.Syncfusion (4.1.0.0)

Represents a JavaScript handler attached to an event fired by the third party widget.

public class WidgetEventHandler

The handler receives the event data of the third party widget in the argument e. The wrapper adds to it the field e.container, which refers to the wisej.web.Widget instance, and sets e.type to the name of the handler. Inside the handler "this" refers to the third party widget, not to the wisej.web.Widget instance.

Example:

The following example shows the selected date in the browser when the date picker fires select.

this.datePicker1.WidgetEvents = new[]
{
new ejBase.WidgetEventHandler
{
Name = "select",
Source = "alert('Selected: ' + e.value);"
}
};

Constructors​

Instance member WidgetEventHandler()​

Initializes a new instance of WidgetEventHandler.

Properties​

Instance member Name​

String: Returns or sets the name of the event to handle. (Default: "")

The name is the name of the event as defined by the Syncfusion widget, i.e. rowSelected for ejGrid. Any text that follows an opening parenthesis is ignored, so that rowSelected(e) is the same as rowSelected. Handlers without a name are ignored.

Instance member Source​

String: Returns or sets the JavaScript source code of the WidgetEventHandler.

The value is the body of a JavaScript function that receives the event data in the argument e. Use e.container.fireWidgetEvent(type, data) to send a custom event to the server, where it is received through the WidgetEvent event. Handlers without source code are ignored.

Example:

var handler = new ejBase.WidgetEventHandler();
handler.Name = "rowSelected";
handler.Source = "e.container.fireWidgetEvent('orderSelected', { id: e.data.OrderID });";