Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dispaly table data in ajax table

Posted on 2009-04-03
2
Medium Priority
?
213 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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

660 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