Home » Structures » Structures_DataGrid » Bug #7927
pass row and col through to formatter function
Details
| Request #7927 | pass row and col through to formatter function |
|---|---|
| Submitted | 2006-06-16 15:17 UTC |
| From | clark at thirteen dot net |
| Assigned | wiesemann |
| Status | Closed |
| Package | Structures_DataGrid |
| PHP Version | 5.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