Dispaly table data in ajax table

Posted on 2009-04-03
Last Modified: 2012-05-06
I want to pull all the data from the table annd be able to sort it with AJAX based on column title. THis is a classic asp page.

Columne names:
ID, firstName, lastName, emailAdd, title, company, ipAddress, phone, country, interestedIn, comments, dateSubmitted, duplicate, completed
<div class="display">

<table cellpadding="5" cellspacing="0">


<td class="header">ID</td> 

<td class="header">First Name</td> 

<td class="header">Last Name</td> 

<td class="header">Email</td> 

<td class="header">Title</td> 

<td class="header">Company</td> 

<td class="header">ipAddress</td> 

<td class="header">Phone</td> 

<td class="header">Country</td> 

<td class="header">Interested IN</td> 

<td class="header">Comments</td> 

<td class="header">Date Submitted</td> 

<td class="header">Dup</td> 

<td class="header">Comp</td>



dim blnOdd

blnOdd = True

 count = Request("count")

 On Error Resume Next


 do while Not objRS.eof

 If blnOdd Then 

        theColor = "#ffffff" 


        theColor = "#dedede" 

 End If

 blnOdd = not blnOdd



<td  bgcolor="<%=theColor%>"><% Response.Write objRS("ID") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("firstName") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("lastName") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("emailAdd") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("title") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("company") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("ipAddress") %></td>

<td bgcolor="<%=theColor%>" nowrap><% Response.Write objRS("phone") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("country") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("interestedIn") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("comments") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("dateSubmitted") %></td>

<td bgcolor="<%=theColor%>"><% IF objRS("duplicate")=1 Then%>Yes<%ELSE%> <%END IF%></td>

<td bgcolor="<%=theColor%>"><% IF objRS("completed")=1 Then%>Yes<%ELSE%> <%END IF%></td>










Set objRS = Nothing


Set objConn = Nothing


Open in new window

Question by:pGustafson

Accepted Solution

mahadevan_v earned 500 total points
ID: 24068412
This is exactly what you want.. check it

you can send a parameter to the select query for sorting based on the column selected
set the attribute in the cells of header row .. pass it to query and return the complete html table

Happy coding :)

Author Closing Comment

ID: 31566303
Thank you very much!

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now