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

Subscribe to our news:
Partners

MaxDB PHP Generator online Help

Prev Return to chapter overview Next

Columns related methods

The grid has eight main presentations. Specific set of columns can be defined for each of presentation.

 

The following methods can be used to get a column of each of presentation.

 

Signature

Description

getViewColumn($columnName)

Returns the column in a table grid with the specified name.

getSingleRecordViewColumn($columnName)

Returns the column in a view form with the specified name.

getExportColumn($columnName)

Returns the column for an export with the specified name.

getPrintColumn($columnName)

Returns the column for a print with the specified name.

getCompareColumn($columnName)

Returns the column in a comparison page with the specified name.

getInsertColumn($columnName)

Returns the column in an insert form with the specified name.

getEditColumn($columnName)

Returns the column in an edit form with the specified name.

getMultiEditColumn($columnName)

Returns the column in a multi-edit form with the specified name.

 

The code in the examples below is used in the OnPreparePage event handler:

 

Example 1:

To hide the 'owner' column in a table grid, use the following code:

 

$column = $this->GetGrid()->getViewColumn('owner');

$column->setVisible(false);

 

 

Example 2:

To set a caption for the 'status' column of a view form, use the following code:

 

$column = $this->GetGrid()->getSingleRecordViewColumn('status');

$column->setCaption('New caption');

 

 

Example 3:

To set the 'approved' editor to read only in an edit form, use the following code:

 

$column = $this->GetGrid()->getEditColumn('approved');

$column->SetReadOnly(true);



Prev Return to chapter overview Next