Forum Moderators: open

Message Too Old, No Replies

js to swap image and change query string

         

maureend

2:30 pm on May 6, 2005 (gmt 0)



I'm new to this forum and hope someone can help me. I have an application which displays a table of data based on a query string. Part of the query string is the value pair "order=abc" or "order=cba" for depending on if the data is sorted in ascending or descending order.

I want to have a small arrow image in the column header whereby if clicked will change the sort order to the opposite of what it currently is - a toggle. At the same time it will swap out the image to the down arrow if it is currently the up arrow and vice versa.

Basically the logic is:

keep the existing URL but if order=abc, set the order=cba (and vice versa); and swap the up_arrow.gif with down_arrow.gif and vice versa.

I'm just having trouble writing this.

orion_rus

3:44 pm on May 6, 2005 (gmt 0)

10+ Year Member



You can sort this information on a client side, why do you need to do it on a server side?
You can show a down arrow, and swap an up arrow at the begining of loading
good luck to you
p.s. To understand how javascript sorts it, you need to google a javascript datagrid