See my old solution:
http:Q_21759382.html#16130
Main Topics
Browse All TopicsI have a dynamically generated table/contents that i want to give the user the ability to sort on multiple columns, columns will not always be beside each other
Rep Name (multiple occurrennces) Building ID (Multiple occurences per rep) Building Name Employee Name Job code
theer can be any number of fields and the user can sort on multiple field
so i give teh user a group of drop downs that lets tehm selet up to 5 fields on which to sort, i then pass teh column indexes to a function and dynamucally sort on those selections....
how?
TIA
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
See my old solution:
http:Q_21759382.html#16130
>>My assumption is that all first four fields are unique, therefore you need NOT to sort for the first four fields when you also sort for the fifth field. Sort only the fifth field alone and you have the same sort order!
would be true if the output could be sorted on the rep name when generated by the SQL, unfortunately, the source for all the data, other than the rep name, comes form an oracle server while the rep name is a local table on an SQL server and has to be matched up to the during the ouput loop, so i have base data sorted/ordered on the building id which means teh rep info is not sequential
eg
REP Building ............
Joe 0036
Mike 0099
steve 0429
Joe 0488
steve 0489
so if the user want to see all of joes buildings together they need to sort it on joe, but at teh same time i would like to keep teh building order also so that it goes like
REP Building ............
Joe 0036
Joe 0488
Mike 0099
steve 0429
steve 0489
i did think this through, it's just that the way the data is gathered affects the final output, and needs to be sorted AFTER being displayed
Does not the EE ranking list sort like you ask for?
http://eeqp.com/stats/hof.
I understand what you WANT, but I have the impression that you did not understood what I am trying to tell to you: you do overcomplicate the interface for an option that is USELESS in real life tables.
Look again at http://eeqp.com/stats/hof.
Now sort two times for the 7th column labeled "Change".
If you do that sort after the page is loaded and no other sorting was before the two times Change sort, then you will see that zero points changers are sorted ascending in the third column: Pos/Ranking
Now sort for the first column "Experts" and sort again two times the "Change" column.
Now you see that first column is sorted in alphabetic ascending order for the zero changers. You see?
So my recommendation is to avoid overloading of user interface and sort in last order first way the columns that are relevant for final sorting result, in your case, sort first for Building and then for REP and you will get the table as you like it, sorted by REP and for same REPs sorted by Building number. You see?
Because the upper domain is no more accessible here the reference to the source on EE:
http://www.experts-exchang
Business Accounts
Answer for Membership
by: ZvonkoPosted on 2006-05-16 at 12:50:09ID: 16693796
The most people ask for multiple field sort without a moment to imagine when multiple fields sort makes sense.
html rtHOF.js
My assumption is that all first four fields are unique, therefore you need NOT to sort for the first four fields when you also sort for the fifth field. Sort only the fifth field alone and you have the same sort order!
Your Rep, Building and Employee sorting is NOT a sorting but grouping. If you would sort for Employee names, then you can never maintain the building categories
Here a table sort example:
http://eeqp.com/stats/hof.
The script behind the table is this:
http://eeqp.com/stats/zpSo
The main part was designed by me and then extended by amebe, the QuickPost developer!