WidgetEventHandler
Namespace: Wisej.Web.Ext.DevExtreme
Assembly: Wisej.Web.Ext.DevExtreme (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 in the "e" argument. Refer to "e.container" to target the wisej.web.Widget instance; "this" in the context of the function refers to the third party widget.
Constructors
WidgetEventHandler()
Initializes a new instance of WidgetEventHandler.
Properties
Name
String: Returns or sets the name of the WidgetEventHandler. (Default: "")
The name is the name of the option of the DevExtreme widget that receives the handler, i.e. "onValueChanged" or "onItemClick". Anything that follows an opening parenthesis is ignored, so "onValueChanged(e)" is equivalent to "onValueChanged". A null value is converted to an empty string.
Source
String: Returns or sets the JavaScript source code of the WidgetEventHandler.
The value is the body of the function, without the function declaration. The event data is available in the e argument and e.container refers to the Wisej.NET widget. A null value is converted to an empty string.
Example:
The following example defines a handler that sends the clicked item of a list to the server.
var handler = new dxBase.WidgetEventHandler();
handler.Name = "onItemClick";
handler.Source = "e.container.fireWidgetEvent('itemSelected', { index: e.itemIndex });";
this.dxList1.WidgetEvents = new[] { handler };