Re: Attributes in rows with Datagrid
| From: | Mark Wiesemann | Date: | Wed, 12 Jul 2006 12:27:47 +0000 |
| Subject: | Re: Attributes in rows with Datagrid | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24621@lists.php.net to get a copy of this message | ||
Jose Manuel Zea wrote:
> I´m using Structures Datagrid, but now I need to set an unique id for each
> row in the HTML code. I need this because want to insert through AJAX some
> HTML blocks after a specific row.
You want to add an attribute to the <tr> tag? There is currently no way
to do this with SDG and SDG_R_HTMLTable. However, you could extend the
SDG_R_HTMLTable class and add this behaviour to the overloaded
buildRow() method.
Or: use your own HTML_Table instance, call $dg->fill($table) and add the
attribute via $table->updateRowAttributes() (or $tbody =&
$table->getBody(); $tbody->updateRowAttributes()). But the first
approach is cleaner and maybe also easier.
Regards,
Mark