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 #8091

User defined formatters with automatically generated columns

Details

Request #8091User defined formatters with automatically generated columns
Submitted2006-06-30 14:05 UTC
Frommichel dot dhooge at gmail dot com
StatusBogus
PackageStructures_DataGrid
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2006-06-30 14:05 UTC] michel dot dhooge at gmail dot com

Description:
------------
IMHO it is nice to be able to define column formatters even if you let the DataSource object create the columns for you.

Attached is a small patch that shall do this:
http://www.phpfi.com/126701

PS : Corresponding comment isn't included (and yet to be written ;-)

[2006-06-30 16:42 UTC] olivierg at php dot net

First, Formatters are 100% about rendering. They have nothing to do with DataSources. That's a deep design issue. I Recommend that you read bug #7710 about this.

And you already can define formatters on generated columns. Just retrieve the generated column with DataGrid::getColumnByName(), or DataGrid::getColumnByField(), and then call setFormatter() on it.

[2006-07-03 09:44 UTC] michel dot dhooge at gmail dot com

I missed bug #7710 when looking about that interference between DS and renderers. Sorry.

So I fully agree with bug #7710 that something must be done to clearly separate the use of "fields". This is one of the reasons that misled me to define that formatters option in DataObject, even though I wasn't happy with it since my formatters were only HTML oriented.

On the other hand, I still believe that being able to define the columns' formatters ("à la FormBuilder") with no code (beside the formatters' code) is handy. If you feel this solution is worth implementing, I can provide a patch for the Renderers...