PEAR is archived and read-only

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

Home » Structures » Structures_DataGrid_Renderer_HTMLTable » Bug #8180

adding rows to HTML Table Renderer output

Details

Request #8180adding rows to HTML Table Renderer output
Submitted2006-07-11 10:28 UTC
Frombennythebee at gmail dot com
Assignedwiesemann
StatusWont fix
PackageStructures_DataGrid_Renderer_HTMLTable
PHP Version5.1.4
OSDebian Sarge
Roadmaps(Not assigned)

Comments

[2006-07-11 10:28 UTC] bennythebee at gmail dot com

Description:
------------
I would like to be able to add a row below each table row output by the Structures_DataGrid HTML_Table renderer.

I tried doing a

global $table;
$table->addRow(array("foo"),array("colspan" => 3));

in the column formatter of the row's last column, but this will result in all the table rows being added on top of the output.

Can this be done somehow?

Thank you!

[2006-07-11 15:22 UTC] bennythebee at gmail dot com

Hi,

thank you for the hint. I was able to add the rows like this, using a hackish concept:

foreach($table->_tbody->_structure as $rownum => $content) {
$row = array_shift($table->_tbody->_structure);
$temparray[] = $row;
$temparray[] = array(0 => array("contents" => "bar","type" => "TD","attr" => array("colspan" => 5)));
}
$table->_tbody->_structure = $na;
$table->toHtml();

...but this doesn't help me a lot, because I have no way to set the ID of the inserted row's div to a value which has to come from the dataset (unique value).

I want to do an ajax call with that value (ignore the above code...it's just meant as an example).

Is it possible to set row attribs through Structures_DataGrid to some value from the Dataset? I would be able to access the DOM for that value then.

Or, any other ideas?

Thank you!
Benny