Solved

Dispaly table data in ajax table

Posted on 2009-04-03
2
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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 …

733 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