Home » Structures » Structures_DataGrid » Bug #8353
A group by column would be very useful
Details
| Request #8353 | A group by column would be very useful |
|---|---|
| Submitted | 2006-08-03 16:47 UTC |
| From | pear at simonellistonball dot com |
| Status | Wont fix |
| Package | Structures_DataGrid |
| PHP Version | Irrelevant |
| OS | n/a |
| Roadmaps | (Not assigned) |
Comments
[2006-08-03 16:47 UTC] pear at simonellistonball dot com
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');
[2006-08-03 17:08 UTC] olivierg at php dot net
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 22:01 UTC] olivierg at php dot net
Okay, we won't fix this. Thanks for your report anyway.