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

Subscribe to our news:
Partners
Testimonials
Ananda Theerthan J: "I have been looking for PHP generator for years and now I am happy that I found one. Yes, its the PHP generator for MySQL. I completely rate 10/10 for this product for making life easier. It has lot of features and capabilities especially the CRUD, lookups and data partitioning. I love this product and recommend to others".
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

OnCustomDrawRow

This event occurs on rendering a grid row. It is an extremely useful event for conditional formatting such as changing font color, font styles, row background color, cell background color, etc. This event (as well as the OnExtendedCustomDrawRow one) is used for conditional formatting. The only difference between these two events is that OnCustomDrawRow has a more understandable parameter list while OnExtendedCustomDrawRow provides more flexible abilities.

 

Signature:

function OnCustomDrawRow ($rowData, &$cellFontColor, &$cellFontSize, &$cellBgColor,

    &$cellItalicAttr, &$cellBoldAttr)

 

Parameters:

$rowData

The associative array of values that corresponds to the currently processed row.

$cellFontColor

The parameter allows to set a font color for selected fields.

$cellFontSize

The parameter defines a font size of selected data.

$cellBgColor

The parameter allows to set a background color of fields.

$cellItalicAttr

Set the parameter to true to represent text in cursive font.

$cellBoldAttr

Set the parameter to true to use bold font.

 

NB. $rowData array keys should contain the real column names in the data source (table, view, or query). Don't use column captions instead!

 

Example 1:

Suppose we need to create a webpage with list of customers with addresses represented in cursive. This column in the data source is named 'address_id' and the column's caption is "Address".

 

To define the font attribute, use the following code:

 

$cellItalicAttr['address_id'] = true;

 

Example 2:

In the example below we need to display winning team score in red and losing team score in black; moreover, both scores should be in bold and displayed by a 16pt font.

 

$cellFontSize['home_team_score'] = '16pt';

$cellBoldAttr['home_team_score'] = true;

 

$cellFontSize['away_team_score'] = '16pt';

$cellBoldAttr['away_team_score'] = true;

 

if ($rowData['home_team_score'] > $rowData['away_team_score'])

  $cellFontColor['home_team_score'] = '#F65317';

else

  $cellFontColor['away_team_score'] = '#000000';



Prev Return to chapter overview Next