Home » Structures » Structures_DataGrid » Bug #8091
User defined formatters with automatically generated columns
Details
| Request #8091 | User defined formatters with automatically generated columns |
|---|---|
| Submitted | 2006-06-30 14:05 UTC |
| From | michel dot dhooge at gmail dot com |
| Status | Bogus |
| Package | Structures_DataGrid |
| PHP Version | Irrelevant |
| 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...