This topic is locked

Show All button help

3/7/2006 3:04:03 PM
ASPRunnerPro General questions
T
tsigley author

Hello. I'm having issues with a project that we run to manage new pc setup and deliveries. When you first log into the page the SQL query(gotten from turning vdebug = true) is
but when you use the system for a little while, like adding entries, sorting, searching, etc, then want to go back to the default view by clicking on "Show All" is sorts by a different field. For example:
[color=#FF0000]select Assignee, ID, [Date Request Received], [Request Form Sent], [Request Form Received], [Software List Received], [Software List Requested], [VHD Ticket Created], [TheAction], [In Process], [User], [Machine], [Location], [Service Tag], [Notes], [Delivered], [Tech Delivered] From [pcs] order by [Software List Requested] asc
Any help on getting the "Show All" button to go back to the default view would be appreciated.

Sergey Kornilov admin 3/7/2006

You can modify CalculateOrderBy Sub on the list page for this purpose. See my changes in bold:

if strOrderBy<>"" then

strOrderByClause = " order by " & strOrderBy & " " & strDir

else

strOrderByClause = " " & gstrOrderBy

end if
if Request("SearchFor")="" and Request("action")="Search" then

strOrderByClause = " " & gstrOrderBy

strOrderImage=""

end if

Session(strTableName & "_OrderBy") = strOrderBy

T
tsigley author 3/8/2006

You can modify CalculateOrderBy Sub on the list page for this purpose. See my changes in bold:


My CalculateOrderBy sub doesn't look like that at all..
Sub CalculateOrderBy
if Request.Form("action")="OrderBy" then

strOrderBy = " order by " & AddWrappers(Request.Form("orderby"))

if Request.Form("SQL")<>"" then

nInd = InStr(1, Request.Form("SQL"),"order by ")
if nInd>0 then

if Left(Mid(Request.Form("SQL"),nInd+Len("order by ")),Len(AddWrappers(Request.Form("orderby")))) = AddWrappers(Request.Form("orderby")) _

and Right(Request.Form("SQL"),3) = "asc" then

strOrderBy = strOrderBy & " desc"

else

strOrderBy = strOrderBy & " asc"

end if

else

strOrderBy = strOrderBy & " asc"

end if

else

strOrderBy = strOrderBy & " asc"

end if
if right(strOrderBy,3)="asc" then

strOrderImage="up.gif"

else

strOrderImage="down.gif"

end if

else

strOrderBy = Request.Form("orderby")

if strOrderBy="" and Request.Form("SQL")="" then strOrderBy=gstrOrderBy

end if
End Sub

Sergey Kornilov admin 3/8/2006

My advise applies to ASPRunnerPro 4.0.
It appears you use older version. Consider upgrading to ASPRunnerPro 4.0.