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

Subscribe to our news:
Partners
Testimonials
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".
Steven Langfield: "I wanted to drop you a mail to say how freaking AMAZING your software is. It will be the best £100 I have ever spent. I have still to read all your documentation to take full advantage but what you have created is truly amazing".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnPreparePage

This piece of code is a method of the Page class that is called at the end of the constructor. It allows you to customize all members of the class.

 

Signature:

function OnPreparePage()

 

Parameters:

This method has no parameters.

 

Example

The following code hides the update_date_time column from the data grid and Single Record View form as well as the status column from Edit and Insert forms from all users except ones who have the Admin privilege for the current page.

 

if (!GetApplication()->IsLoggedInAsAdmin()) {

    $updateDateTimeColumnName = 'update_date_time';

    $column = $this->GetGrid()->getSingleRecordViewColumn($updateDateTimeColumnName);

    if ($column) {

        $column->setVisible(false);

    }

    $column = $this->GetGrid()->getViewColumn($updateDateTimeColumnName);

    if ($column) {

        $column->setVisible(false);

    }

 

    $statusColumnName = 'status';

    $column = $this->GetGrid()->getEditColumn($statusColumnName);

    if ($column) {

        $column->setVisible(false);

    }

    $column = $this->GetGrid()->getInsertColumn($statusColumnName);

    if ($column) {

        $column->setVisible(false);

    }

}

 

See also: OnPageLoaded.



Prev Return to chapter overview Next