AnewtGridCellRenderer Class Reference

A cell renderer for the AnewtGridRenderer. More...

List of all members.

Public Member Functions

 __construct ($id)
 Constructs a new AnewtGridCellRenderer.
 render_cell ($data)
 Renders the cell.

Public Attributes

 $id
 The id of this cell renderer.

Protected Member Functions

 create_td ($value)
 Create a XHTML cell based on the provided value.
 fetch_value_from_data ($data)
 Fetch default value from the row data, based on the cell renderer id.

Private Attributes

 $_column
 Reference to the parent column.


Detailed Description

A cell renderer for the AnewtGridRenderer.

This grid renderer just renders the data as a cell (without any special effects).

Definition at line 15 of file cell.lib.php.


Constructor & Destructor Documentation

AnewtGridCellRenderer::__construct ( id  ) 

Constructs a new AnewtGridCellRenderer.

Parameters:
$id The id for this cell renderer. It will be used to match against the row data in the grid.

Reimplemented from AnewtContainer.

Definition at line 27 of file cell.lib.php.


Member Function Documentation

AnewtGridCellRenderer::render_cell ( data  ) 

Renders the cell.

Parameters:
$data Data to pack into the cell
Returns:
Rendered cell

Reimplemented in AnewtGridCellRendererHyperlink, AnewtGridCellRendererCount, and AnewtGridCellRendererDate.

Definition at line 46 of file cell.lib.php.

AnewtGridCellRenderer::create_td ( value  )  [protected]

Create a XHTML cell based on the provided value.

This method handles a variety of data types easibly convertible to strings, and takes the highlight property of the AnewtGridColumn into account when rendering into a HTML <td> table cell. You can use this method to render the final result in custom cell renderers (after doing done your custom formatting based on the row data).

Parameters:
$value Value to render
Returns:
XHTML snippet for a table cell

Definition at line 69 of file cell.lib.php.

AnewtGridCellRenderer::fetch_value_from_data ( data  )  [protected]

Fetch default value from the row data, based on the cell renderer id.

This method is used internally to fetch the cell data from the row data object. Both associative arrays and AnewtContainer objects are handled. Which value is retrieved depends on the id of the cell renderer; if you did not instantiate an AnewtGridCellRenderer yourself, this is will be the same as the column id.

Custom AnewtGridCellRenderer subclasses may use this method as a convenience method to get data from the row object prior to further processing or formatting.

Parameters:
$data Row data
Returns:
Value extracted from row data, based on the id

Definition at line 104 of file cell.lib.php.


The documentation for this class was generated from the following file:

Generated on Sun Aug 2 22:54:37 2009 for Anewt by  doxygen 1.5.9