Show/Hide Toolbars

Navigation: Advanced topics

ASPRunnerPro32x32     ASPRunnerPro manual


How to access fields in the field events

Scroll Prev Next More

How to access fields in the field events

You can access fields from the ClientBefore, ClientAfter events

Variables available in the field events:

ctrl - current field, Control object

 

pageObj - RunnerPage object

 

ctrl.setValue(100);

 

ctrl.getPeer( field )

 

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

 

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

 

pageObj.getControl( fieldName )

 

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

 

var ctlPrice = pageObj.getControl('price');
ctlPrice.setValue( 1000 );

You can also access fields from the Server event:

$result - array of values to return from the server          

 

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

$data = $ajax->getCurrentRecord();
$result["record"] = $data;
$result["email"] = $data["email"];