constructor Structures_DataGrid::
Structures_DataGrid
(Previous)
(Next) Structures_DataGrid::attachRenderer

View this page in Last updated: Sun, 28 Sep 2008
English | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Plain HTML

Structures_DataGrid::addColumn()

Structures_DataGrid::addColumn()  -- Add a column, with optional position

Description

This package is not documented yet.

Parameter

&$column

string $position

One of: "last", "first", "after" or "before" (default: "last")

string $relativeTo

The name (label) or field name of the relative column, if $position is "after" or "before"

object $column

The Structures_DataGrid_Column object (reference to)

Return value

returns PEAR_Error on failure, void otherwise

Throws

throws no exceptions thrown

Note

This function can not be called statically.

constructor Structures_DataGrid::
Structures_DataGrid
(Previous)
(Next) Structures_DataGrid::attachRenderer

Download Documentation Last updated: Sun, 28 Sep 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: pierre2543@hotmail.com
If you are binding with a datasource and also want to add a column, make sure you call generateColumns() prior to adding your custom column. If you don't, none of the columns from the datasource will appear in your output.

Here's an example:
$dataobject = new DO_Task();
$datagrid =& new Structures_DataGrid(10);
$datagrid->bind($dataobject);
$datagrid->generateColumns(); //important!!
$datagrid->addColumn(new Structures_DataGrid_Column(
'Actions',
null,
null,
null,
null,
array('actionColumnCallback'),
'last'
));

$output = $datagrid->getOutput();

// Print rendering error if any
if (PEAR::isError($output))
echo $output->getMessage();
else
echo $output;