Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics

How to access fields in the field events

Scroll Prev Next More

Access fields from ClientBefore, ClientAfter events

Variables available in the field events

ctrl

the current field, a Control object.

pageObj

a RunnerPage object.

 

Example:

 

Set the value of the current field to 100.

 

ctrl.setValue(100);

ctrl.getPeer( field )

Returns another field control from the same page of the same row in an inline mode:

 

var ctlPrice = ctrl.getPeer('price');
ctlPrice.setValue( 1000 );

Runner.getControl( pageid, fieldName )

Returns the field control. Works in any events where the pageObj variable is available.

 

var ctlPrice = Runner.getControl( pageid, 'price');
ctlPrice.setValue( 1000 );

Access fields from the Server events

result

an array of values to return from the server.

getCurrentRecord()

returns an associative array with field values (field name => value).

 

XVar data = ajax.getCurrentRecord();
result["record"] = data;
result["email"] = data["email"];

See also:

JavaScript API: Date Control API > setValue()

JavaScript API: RunnerPage object

JavaScript API: Control object

Field Events

Tri-part events