Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sort both ways by clicking on column name

Status
Not open for further replies.

olchiik

Programmer
May 7, 2009
33
0
0
US
Hello,

I have another problem. Now that my sort works perfectly, I was requested to make sure it sorts in both DESC and ASC orders. Does anybody know how to do it????
 
Hi mansii, I have a problem to implement code from FAQ. The problem occurs when I try to output url parameters. Because I need to resubmit form to keep search results when I sort, I use javascript submit() function. When I add #changeOrder('entrydate')# to it, it gives me Javascript syntax error... my code looks like this...could you please help me to find the problem?
<a href="javascript:document.getElementById('sortdate').submit();&#changeOrder('entrydate')#">Date:</a>

 
So, 'sortdate' in
Code:
<a href="javascript:document.getElementById('sortdate').submit();>Date:</a>
is your form ID, right? If so,
1. Any reason why you use javascript in submitting that form? Because I didn't see any needs in passing parameters.
2. The FAQ will re-read your data everytime you click the column header. No need keep previous sort result.

In other word, just follow the FAQ in putting hyperlink (just to change sort order).
I'm sorry if I didn't get your question correctly.

Hope this helps.
 
Mansii...thank you for your help! I found the way. It works!
 
It would be great if post your solution here so it will help other people in solving the same problem.

Regards.
 
Mansii,

I just put those url parameters (url.sortcolumn and url.sortorder) in hidden fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top