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_Smarty » Bug #8730

Structures_DataGrid_Renderer_Smarty => Attributes

Details

Submitted2006-09-19 04:33 UTC
Frombug at toni dot com dot br
Assignedwiesemann
StatusDuplicate
PackageStructures_DataGrid_Renderer_Smarty
PHP VersionIrrelevant
OSWindows/Linux
Roadmaps(Not assigned)

Comments

[2006-09-19 04:33 UTC] bug at toni dot com dot br

Description:
------------
There is no way to use attributes dinamically. This is only available for Structures_DataGrid_Renderer_HTMLTable. I did a small change which allows to use dinamic attributes for the cells.

Test script:
---------------
Example, in the template:

{section name=row loop=$recordSet}<tr {if $smarty.section.row.iteration is even}bgcolor="#f5f5f5"{/if}>{section name=col loop=$recordSet[row]}<td {foreach key=atribKey item=atribValor from=$columnSet[col].attributes} {$atribKey}="{$atribValor}" {/foreach}>{$recordSet[row][col]}</td> {/section}</tr>{/section}

Expected result:
----------------
I want to know its opinion

In the archive Structures_DataGrid_Renderer, in line 655, I modified:
(is_a($this, 'Structures_DataGrid_Renderer_HTMLTable') || is_a($this, 'Structures_DataGrid_Renderer_Smarty')))

In line 657, it was thus:
if (!@array_key_exists($field, $this->_options['columnAttributes'])) {

In the archive Structures_DataGrid_Renderer_Smarty, in line 224, I added the following code:
$prepared[$index]['attributes'] = $this->_options['columnAttributes'][$spec['field']];

Actual result:
--------------
I am from Brazil, sorry my english

[2006-10-15 03:28 UTC] bu at toni dot com dot br

Thank's wiesemann!