Solved

Dispaly table data in ajax table

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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 article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

688 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