Solved

Dispaly table data in ajax table

Posted on 2009-04-03
2
209 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RegEx Help - open to other simple suggestions 8 58
JQuery to parse xml string and get element by id 4 47
Issues with Insert statement 12 29
View SQL 2005 Job package 16 69
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

791 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