WidgetEventHandler
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (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 receives the event data from the third party widget in the "e" argument. Refer to "this" in the context of the handler to target the third party widget, and to "e.container" to refer to the wisej.web.Widget instance.
Constructors
WidgetEventHandler()
Initializes a new instance of WidgetEventHandler.
Properties
Name
String: Returns or sets the name of the event fired by the third party widget that is handled by the WidgetEventHandler, i.e. "rowSelected". (Default: "")
Source
String: Returns or sets the JavaScript source code of the WidgetEventHandler: the body of a function that receives the event data in the "e" argument.
Example:
The following example handles the rowSelected event of a grid in the browser and sends the selected row index to the server, where it is received in the WidgetEvent event.
this.grid1.WidgetEvents = new[]
{
new ej2Base.WidgetEventHandler
{
Name = "rowSelected",
Source = "e.container.fireWidgetEvent('rowPicked', { index: e.rowIndex });"
}
};
this.grid1.WidgetEvent += (s, e) =>
{
if (e.Type == "rowPicked")
AlertBox.Show($"Selected row {e.Data.index}");
};