Solved

Dispaly table data in ajax table

Posted on 2009-04-03
2
208 Views
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">
<tr> 
<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>
</tr>
 
<%
dim blnOdd
blnOdd = True
 
 count = Request("count")
 On Error Resume Next
 objRS.MoveFirst
 do while Not objRS.eof
 
 If blnOdd Then 
        theColor = "#ffffff" 
 Else 
        theColor = "#dedede" 
 End If
 
 blnOdd = not blnOdd
%>
 
<tr>
<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>
</tr>
<%
objRS.MoveNext
Loop
%> 
</table>
</div>
<%
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>

Open in new window

0
Comment
Question by:pGustafson
2 Comments
 
LVL 4

Accepted Solution

by:
mahadevan_v earned 500 total points
ID: 24068412
This is exactly what you want.. check it
http://www.w3schools.com/AJAX/ajax_database.asp

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 :)
0
 

Author Closing Comment

by:pGustafson
ID: 31566303
Thank you very much!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 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