WidgetFunction
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
Represents a JavaScript function attached to the widget on the browser.
- C#
- VB.NET
public class WidgetFunction
Public Class WidgetFunction
Refer to "this" in the context of the function to target the wisej.web.Widget instance, and to "this.widget" to refer to the third party widget.
Constructors
WidgetFunction()
Initializes a new instance of WidgetFunction.
Properties
Name
String: Returns or sets the name of the WidgetFunction: the name used to add the function to the widget in the browser and to refer to it in the options. (Default: "")
Source
String: Returns or sets the JavaScript source code of the WidgetFunction: the body of the function, without the function declaration.
The function is created without named parameters, use "arguments" to read the values passed by the caller. When the function is assigned to an option using the "(a,b)=>name" syntax, the parameters have the names listed between the parentheses.
Example:
The following example adds a function that invokes a method of the EJ2 component and calls it from the server.
this.grid1.WidgetFunctions = new[]
{
new ej2Base.WidgetFunction
{
Name = "selectOrder",
Source = "this.widget.selectRow(arguments[0]);"
}
};
this.grid1.Call("selectOrder", 5);