views:

40

answers:

1

Consider an Explorer-like list view with a number of columns. The data is fetched from a database, and the rows can be sorted by clicking the column headers.

When you click column A, you expect the fetched data to be sorted by A - at the database level ("ORDER BY" at the selected column). However, sometimes it is desirable to sort the data presented in the GUI - the visible data (WYSIWYG).

How do you combine these two? E.g. How do you allow the user to sort both the fetched data and the data visible in the GUI?

Have you seen a GUI that solves this elegantly?

A: 

To combine these 2, you have an row # computed by your database layer or more likely data access layer (literally, 1-N). You then store this "original row #" somewhere - either as an attribute in the <tr> element or as a separate "hidden" <td> element.

Then you have a button or some other method of "re-sort in the orginal order" which does a GUI level re-sort based on this "original order".

You can actually do this in a way more obvious to the user if you simply store "original rank" as a separate visible column in <td> and simply allow re-sorting in the GUI by that column as well.

DVK
So ONE of the GUI columns would sort data on the 'database level'?
NOP slider
It would either re-order them in the same exact order that they were ordered in the database. If you want something else, please explain in detail what you wish to achieve
DVK