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

Subscribe to our news:
Partners
Testimonials
Olivier Auverlot: "At my work (a universitary computer research laboratory), I'm alone to create all applications and databases. I don't know how I could do all the work without it. It's really a very productive software. I can focus on the database schemas and create quickly the user applications with a minimal amount of code to maintain".
Simon Greener: "A lot of work went in to designing our application database. PHP Generator allowed us to build a fully functional, professional looking, and functionally powerful web application from that database. It has freed us from worrying about low level code, enabling us to focus on the business requirements of the customer. The support provided is excellent with staff quickly producing answers to questions ranging from newbie to simple or complex. I highly recommend the product".

More

Add your opinion

PostgreSQL PHP Generator 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