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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching and Dynamic Sorting Problems in the display

Status
Not open for further replies.

Newbedude

Programmer
Jun 6, 2003
9
0
0
US
I was wondering if anyone can point me into the right direction on this and as always i appricate any insight u can give me.
I have a search page and a Display page. Both are separate but are viewed in a frame set.
In the display Page the user can click on the column header to sort the Table accordingly. The sort Values are passed threw urls back to itself.
The Search Page passes the Form values to the display page. I would like to retain the sort values in the display if a new search would occur. What it does now is Resets the sort to the default.
I need to pass these sort values to the search page without using the urls. and if i use hidden form fields i want to pass the Form.sort values to the Search page without having a submit button and Unloading the diplay page.

Also I have a Reset button on the Search page named Clear. My display form is based on Search being defined. When clicked i want it to reset the values and make the Search undefined.
Im lost Thank you for the help in advanced.
 
When a user clicks the sort link, set a cookie, session or client variable (which ever scope works for you). For example - On the Display page after the user clicks a sort link:
<cfif ISDEFINED(&quot;url.sort&quot;)>
<cfset session.sort=url.sort> (choose your scope)
</cfif>


On the top of the Display page (above the query that runs the search), you can set a local variable that will hold the value of the sort. Something like -

<cfif ISDEFINED(&quot;session.sort&quot;)>
<cfset locSort=session.sort>
<cfelse>
<cfset locSort=&quot;default search value goes here&quot;>
</cfif>


Now in your query you can use the #locSort# varible in your ORDER BY statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top