Home » Structures » Structures_DataGrid » Bug #5565
A new way to add Columns
Details
| Request #5565 | A new way to add Columns |
|---|---|
| Submitted | 2005-09-29 21:00 UTC |
| From | wabut at yahoo dot com |
| Assigned | wiesemann |
| Status | Wont fix |
| Package | Structures_DataGrid |
| PHP Version | Irrelevant |
| OS | Win 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;
}