PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Structures » Structures_DataGrid » Bug #5565

A new way to add Columns

Details

Request #5565A new way to add Columns
Submitted2005-09-29 21:00 UTC
Fromwabut at yahoo dot com
Assignedwiesemann
StatusWont fix
PackageStructures_DataGrid
PHP VersionIrrelevant
OSWin XP
Roadmaps(Not assigned)

Comments

[2005-09-29 21:00 UTC] wabut at yahoo dot com

Description:
------------
I find myself doing this a lot

$dg->addColumn(new Structures_DataGrid_Column("Action", "ID", null, "valign=\"top\"", null, "printActionColumn()"));

I figure it would be easier if there was another more specific version of the addColumn function, that would create the Column for you (and save some extra typing).
I haven't really tested this, but something along the lines of

$dg->addColumnDetail("Action", "ID", null, "valign=\"top\"", null, "printActionColumn()");

which is calling

function addColumnDetails($columnName, $fieldName = null,
$orderBy = null, $attribs = array(),
$autoFillValue = null,
$formatter = null)
{
$tempColumn = new Structures_DataGrid_Column($columnName, $fieldName, $orderBy, $attribs, $autoFillValue, $formatter);
$this->columnSet = array_merge($this->columnSet, array($tempColumn));
return true;
}