Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.3

Request #8353 A group by column would be very useful
Submitted: 2006-08-03 16:47 UTC
From: pear at simonellistonball dot com Assigned:
Status: Wont fix Package: Structures_DataGrid (version 0.7.1)
PHP Version: Irrelevant OS: n/a
Roadmaps: (Not assigned)    
Subscription  


 [2006-08-03 16:47 UTC] pear at simonellistonball dot com (simon elliston ball)
Description: ------------ A nice additional feature would be to add a means to groups by a column. For example: -------------------------- | group | record entries | |------------------------| | head1 | record entry1 | | head1 | record entry2 | | head2 | record entry3 | | head2 | record entry4 | | head2 | record entry5 | -------------------------- to: -------------------------- | group | record entries | |------------------------| | head1 | | record entry1 | | record entry2 | | head2 | | record entry3 | | record entry4 | | record entry5 | -------------------------- Acheived by something like $datagrid->groupBy('group');

Comments

 [2006-08-03 17:08 UTC] olivierg at php dot net (Olivier Guilyardi)
This sort of feature is already partly addressed in bug #4565. However I think such "record grouping" is a rather bad idea. What you are asking for is a "Data Tree" not a "Data Grid". The former is based on _hierarchical_ data sources, while a DataGrid is based on _tabular_ data sources. This is conceptually different. Your groupBy() method looks nice and simple. However, I believe it is likely to bloat Structures_DataGrid and its drivers with endless complexity. We could discuss this some more, however I believe a whole new Structures_DataTree package would be a better place to do what you want.
 [2006-08-04 10:11 UTC] wiesemann (Mark Wiesemann)
I agree on Olivier's comment. A grid is not a tree. The problem is also that of the currently available renderers, only the HTMLTable renderer could be a extended with this grouping in a reasonable manner. CSV, XLS, templates etc. can't handle it. For me this looks like a "Won't fix" for Structures_DataGrid, which of course does not mean that you can't propose your idea as a new package.
 [2006-08-04 22:01 UTC] olivierg at php dot net (Olivier Guilyardi)
Okay, we won't fix this. Thanks for your report anyway.