Re: DB_DataObject and Structures_DataGrid integration
| From: | Andrew Nagy | Date: | Fri, 13 Aug 2004 15:22:24 +0000 |
| Subject: | Re: DB_DataObject and Structures_DataGrid integration | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32627@lists.php.net to get a copy of this message | ||
Olivier Guilyardi wrote:
Then, here's what looks smart to me : $datagrid->bind($dataobject); /* Adds all columns as set by fb_fieldsToRender */ $column = new S_DG_C('Edit',...); $datagrid->addColumn($column); ... $datagrid->addColumn($someOtherColumn);The "auto-generation" of columns belongs in the rendering. That is where I have it now. Upon rendering, if no columns have been defined, it will auto-generate the columns. I think the best way to approach this is by creating a source driver for dataobjects and one of the pieces of functionality for this would be an auto-generator of columns. Considering DO specific rendering cannot belong in the renderer now, the only place is in a source driver. I don't totally agree with the "Enhance/Consolidate/Optimize" plan of first reworking the bind method and then reworking it again to use source drivers. Remember this package is in alpha. I would like to include all of these new ideas for a beta release.