Re: Structures_DataGrid
| From: | Olivier Guilyardi | Date: | Wed, 28 Jun 2006 13:44:31 +0000 |
| Subject: | Re: Structures_DataGrid | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24499@lists.php.net to get a copy of this message | ||
Hi Markus,
Markus Ernst wrote:
I try to use Structures_DataGrid for importing Data of various formats. So, after successfully bind()ed the data I would like to get them out as an array with the same structure as used for filling the Array datasource driver. As I did not find some kind of getRecordSet() method in DataGrid, I wonder what would be the appropriate way to get the data out:Please post a feature request. I think we can safely add a getRecordSet() method or create an array renderer. You're not the first to ask that sort of feature, if I remember correctly.
1. Write a new class which inherits Structures_DataGrid and provides a public method to retrieve the recordsetsNo, the $recordSet property is private, not protected.
2. Write a new renderer that returns the data as an arrayYou can do that, yes : subclass SDG_Renderer, "merge" $_columns and $_records in buildBody(), and return the resulting array with getOutput(). Shouldn't be much more than 10 lines.
3. Dirty way: $data = $datagrid->recordSet;No, _all_ properties in SDG are private or protected. -- og