JSDO properties, methods, and events reference : subscribe( ) method (JSDO class)
  

subscribe( ) method (JSDO class)

Subscribes a given event callback function to a named event of the current JSDO or table reference.
For more information on these events, see the reference entry for progress.data.JSDO class.
Return type: null
Applies to: progress.data.JSDO class, table reference property (JSDO class)

Syntax

jsdo-ref.subscribe ( event-name [ , op-name ] ,
event-handler [ , scope ] )
jsdo-ref.table-ref.subscribe ( event-name [ , op-name ] ,
event-handler [ , scope ] )
jsdo-ref
A reference to the JSDO. If you call the method on jsdo-ref, you can subscribe the event handler to any event that fires on the JSDO and all its table references.
table-ref
A table reference on the JSDO. If you call the method on table-ref, you can subscribe the event handler to an event that fires only on the table reference.
event-name
A string that specifies the name of an event to which you subscribe an event handler. See the reference entry for progress.data.JSDO class for a list of available JSDO events.
If you call the subscribe( ) method on table-ref, you can subscribe the event handler only to the following events:
*afterCreate
*afterDelete
*afterUpdate
*beforeCreate
*beforeDelete
*beforeUpdate
op-name
A string that specifies the name of a JSDO invocation method, a call to which causes the event to fire. This parameter is required in cases where event-name is beforeInvoke or afterInvoke. Use it only with these event names, and only when subscribing on the JSDO (not on a table-ref). The value of op-name is the same as the fnName property on the request object.
event-handler
A reference to an event handler function that is called when the specified event fires.
scope
An optional object reference that defines the execution scope of the event handler function called when the event fires. If the scope property is omitted, the execution scope is the global object (usually the browser or device window).

See also:

invocation method, progress.data.JSDO class, unsubscribe( ) method (JSDO class)