Table Sort in JScript or ASP

Results 1 to 5 of 5

Thread: Table Sort in JScript or ASP

  1. #1
    Join Date
    Dec 1969
    Posts
    240

    Default Table Sort in JScript or ASP

    I have a problem. I have an ASP search which queries an SQL Server 6.5 database and I need to bring back the records in a table capable of being sorted. I have found one example in Java Script but I just couldn&#039t seem to get it working properly. Anyone know where I can find a good example? <BR><BR>It would be appreciated.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Table Sort in JScript or ASP

    Use SQL&#039s ORDER BY clause to order your data, not JavaScript or ASP.<BR><BR>See http://www.geocities.com/ResearchTriangle/Node/9672/sqltut.html for a very in depth discussion of all the SQL commands. Specifically, you are interested in the ORDER BY clause.

  3. #3
    Join Date
    Dec 1969
    Posts
    240

    Default RE: Table Sort in JScript or ASP

    I know about the ORDER BY clause. However my problem is after the records have been brought back and put into a table on the web page from the ASP search, the user must be able to click on the column header and sort the records ASC or DESC. I can&#039t seem to get a function working properly to do this. It has been very maddening. Seen anything like this before?

  4. #4
    vijay N Guest

    Default Html,ASP

    hi,<BR>i have some question&#039s<BR>1)can two column values be populated in a ListBox depending upona selection. <BR>2)Is there any mahtod to place controls like textbox ,listbox and so on in a single row without using a table tag.<BR>3)Can you send me some solution on ,say when you choose a value in a Dropdown listbox depending upon that selection i want the related Data to be populated in the Textbox and Listbox.<BR><BR>i will appreciate your reply.<BR><BR>


  5. #5
    Jon Guest

    Default RE: Table Sort in JScript or ASP

    You will need to resubmit the query to the database to change the sorting unless you are using DHTML. If you&#039re using DHTML you could hold the data in an array and resort it or you could use disconnected recordset&#039s. If you&#039re using a typical asp page, you really only get one pass at the data, after the server processes the page the recordset and connection to the database should have been destroyed. <BR><BR>All you need to do is add a parameter to your query string or form and then resubmit the page. Check the value of the sorting parameter/s and modify the order by clause of your sql statement in an if block or select case statement. The target of a form submit or a link can be the same page as the user is currently on. The server will just process the page again and give the user the new results.<BR><BR>Hope the info helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •