Home » Structures » Structures_DataGrid » Bug #9444
Sorting by fields not added as column
Details
| Request #9444 | Sorting by fields not added as column |
|---|---|
| Submitted | 2006-11-24 15:41 UTC |
| From | benn at discardmail dot de |
| Assigned | wiesemann |
| Status | Wont fix |
| Package | Structures_DataGrid |
| PHP Version | 5.1.2 |
| OS | Debian Sarge |
| Roadmaps | (Not assigned) |
Comments
[2006-11-24 15:41 UTC] benn at discardmail dot de
Description:
------------
Currently, Renderers such as HTMLTable can only output sort headers for actual columns added to the DataGrid.
As I am grouping several columns from the result set into one column of the DG using a column formatter, I am not able to sort by these fields.
Expected result:
----------------
I would like to be able to define fields from the result set as sortable fields. These should show up in the header to have clickable sort links, but not as columns inside the grid. Strange idea?
[2006-11-27 15:37 UTC] benn at discardmail dot de
Okay for example I have this SQL query:
SELECT NAME,STREET,POSTCODE,CITY,COUNTRY FROM FRIENDS;
and my DG has just 1 column called "Friendadress" which contains all the fields (via a formatter):
row# friendadress
1 NAME
STREET
POSTCODE
CITY
COUNTRY
2 NAME
STREET
(etc.)
I can add 1 column (i.e. Name) to the DataGrid and I am able to sort by it. But, I want to be able to sort by all the fields from the database, regardless if I add them as their own column.
It would be nice if the sorting fields would be determined by the datasource, not the resulting grid.
Alternatively, is there a way to get an Array of all the fields contained in the Datasource, and will SDG sort by fields not being added as columns?
[2006-11-27 15:50 UTC] benn at discardmail dot de
By the way, this is useful when:
- Your DG is not a 1:1 representation of the underlying datasource table
[2006-12-14 18:04 UTC] olivierg at php dot net
Another solution could consist in using the HTMLSortForm Renderer instead of sorting links.