PEAR is archived and read-only

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

Home » Structures » Structures_DataGrid » Bug #7927

pass row and col through to formatter function

Details

Request #7927pass row and col through to formatter function
Submitted2006-06-16 15:17 UTC
Fromclark at thirteen dot net
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid
PHP Version5.1.2
Roadmaps(Not assigned)

Comments

[2006-06-16 15:17 UTC] clark at thirteen dot net

Description:
------------
In certain cases, albeit not frequently, it is nice to know, inside a formatter function, what row and column of the datagrid we are in. This information may influence how we are formatting the current cell.

The way I am using it is to set the style class of the table cell based on the content. ie,

if($params['record'][$fieldName] == 'special-value') {
$table->setCellAttributes($params['currRow'], $params['currCol'], array('class' => 'special-style'));
}

I have implemented this feature in my CVS tree.

Test script:
---------------
Here are the patches necessary:

http://thirteen.net/~clark/Structures_DataGrid/Renderer-patch.txt
http://thirteen.net/~clark/Structures_DataGrid/Column-patch.txt

They were both generated by

diff -Naur old new

Expected result:
----------------
n/a

Actual result:
--------------
n/a