Class TIWBSCustomAsyncEvent
Unit
IWBSCustomEvents
Declaration
type TIWBSCustomAsyncEvent = class(TCollectionItem)
Description
Hierarchy
- TCollectionItem
- TIWBSCustomAsyncEvent
Overview
Methods
 |
constructor Create(Collection: TCollection); override; |
 |
destructor Destroy; override; |
 |
function GetScript: string; |
 |
procedure Assign(Source: TPersistent); override; |
 |
procedure ParseParam(AScript: TStringList); |
 |
procedure RegisterEvent(AApplication: TIWApplication; const AComponentName: string); |
Properties
 |
property AutoBind: boolean read FAutoBind write FAutoBind default False; |
 |
property CallBackParams: TStringList read FCallBackParams write SetCallBackParams; |
 |
property EventName: string read FEventName write SetEventName; |
 |
property EventParams: string read FEventParams write FEventParams stored IsEventParamsStored; |
 |
property OnAsyncEvent: TIWAsyncEvent read FAsyncEvent write FAsyncEvent; |
Description
Methods
 |
constructor Create(Collection: TCollection); override; |
|
 |
destructor Destroy; override; |
|
 |
function GetScript: string; |
Return the javascript code necessary to execute the callback
|
 |
procedure Assign(Source: TPersistent); override; |
|
 |
procedure ParseParam(AScript: TStringList); |
Search in a script and replace params with same name as EventName with the js code necessary to execute the callback.
|
 |
procedure RegisterEvent(AApplication: TIWApplication; const AComponentName: string); |
Register the callback in the server. Is for internal use, don't use it.
|
Properties
 |
property AutoBind: boolean read FAutoBind write FAutoBind default False; |
Specifies if the delphi event will be automatically binded to the jQuery control with the EventName specified. If true, the event will be automatically attached to the rendered object. If false, you need to manually bind the event. To manually bind an event in delphi code you could do:
IWBSExecuteJScript(MyObject.JQSelector+'.on("api.event.name", function(event, param1, param2) {'+MyObject.CustomAsyncEvents[0].GetScript+'})');
or you can add in the script property:
$("#{%htmlname%}").on("api.event.name", function(event, param1, param2) { {%eventname%} });
|
 |
property CallBackParams: TStringList read FCallBackParams write SetCallBackParams; |
Mainteins a list of pairs names=values to translate the EventParams to the params pased to the OnAsyncEvent
|
 |
property EventName: string read FEventName write SetEventName; |
Specifies the event name, if AutoBind = True, the EventName should be exactly the name of the jQuery event, if AutoBind = False you can set any name here and use the correct one when you manually register it.
|
 |
property EventParams: string read FEventParams write FEventParams stored IsEventParamsStored; |
Specifies a list of comma separated names of params that the event will pass to the callback function. This params names are defined in the api of the object you are using.
|
 |
property OnAsyncEvent: TIWAsyncEvent read FAsyncEvent write FAsyncEvent; |
Occurs when the defined JQ event is triggered
|
Generated by PasDoc 0.14.0.
|