Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Jonathan Oakes: "This is a lovely application. It's easy to hook into my own bespoke applications. It's very powerful, yet really quite simple to use. Thanks for this".
Rickey Steinke: "Folks, I wanted to drop a line and give you a fanatic thank you. I have a project due for my computer application course and without PHP Generator I never would have gotten it done with the professional results your product produced. My sincerest gratitude to each and every team member who brought this program to light".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnCalculateControlValues

This event occurs whenever the values of calculated columns are (re)computed in Edit and Insert forms. Live examples.

 

Signature:

function OnCalculateControlValues(editors)

 

Parameters:

editors

An associative array of form controls. To access the value of the editor of the column_name column, use the editors['column_name'] syntax.

 

Example 1:

This code snippet sets the value of the control displaying the full name according to values entered in the controls displaying first and last names.

 

editors['full_name'].setValue(editors['first_name'].getValue() + ' ' + 

    editors['last_name'].getValue());

 

Example 2:

This code snippet sets the value of the control displaying the age according to the entered birthday. To simplify the code, the Moment.js library is used.

 

if (editors['birthday'].getValue()) {

    require(['moment'], function(moment) {

        editors['age'].setValue(

            moment().diff(editors['birthday'].getValue(), 'years')

        );

    });

}

 

See also:

OnCalculateFields.



Prev Return to chapter overview Next