[Structures_DataGrid] Additional headers
| From: | Daniel García | Date: | Fri, 18 Feb 2005 09:51:52 +0000 |
| Subject: | [Structures_DataGrid] Additional headers | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17566@lists.php.net to get a copy of this message | ||
Hi all,
I'd like to render a table with headers above the "main" header, that is, the header that handles ordering. These additional headers are used in order to group headers, for example:
<table width="50%" cellspacing="1" cellpadding="4" class="datagrid">
<!-- additional header -->
<tr bgcolor="#3399FF">
<th colspan="2">Person info</th>
<th colspan="2">Actions</th>
</tr>
<!-- default header -->
<tr bgcolor="#3399FF">
<th><a href="/example.php?orderBy=first_name&direction=ASC">Name</a></th>
<th><a href="/example.php?orderBy=age&direction=ASC">Age</a></th>
<th>Edit</th>
<th>Delete</th>
</tr>
</table>
I haven't seen a way using the package methods, and I'm thinking of managing this additional headers creating another renderer based on (inheriting) the HTMLTable renderer, which would handle this. E.g.
$dg->renderer->setSuperheaders (array (
0 => array(
0 => array(
'cols' => 2,
'label' => 'Person info'),
1 => array(
'cols' => 2,
'label' => 'Actions')
)
));
Any work done on this so far? Advice? I'd hate to reinvent this wheel.... :-)
King regards,
-- Daniel