jQuery makes it SUPER simple to add and remove items from the DOM.
Assuming you already have a table with an ID of #myTable that looks like
this:
<table id="myTable">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>Andy</td>
<td>Matthews</td>
</tr>
</tbody>
</table>
$('#myTable tbody').append('<tr><td>james</td><td>joyce</td></tr>');
That would add an additional TR to the table. The strings james and joyce
would come from whatever AJAX method you use to get that data.
-----Original Message-----
From: Matthew Williams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 19, 2007 4:34 PM
To: CF-Talk
Subject: Need to update HTML table rows using a webservice
Hey ya'll
I have need to jump into the latest craze and start using Ajax (I think).
What I have is this...
A user performs a search. The results of said search are stored in a
structure, which is then stored in an array. This is then stored in the
session scope. The user is then displayed 10 results. There are two
options available to said user. Either send a person in the results a
message, or delete the person from the displayed results. Both actions
should remove the single entry from the display, and the next in line should
appear. Now, I could be all dull and resubmit the page to do this, but I'd
love to use a webservice call and javascript to add another row. Anyone
have any thoughts on this?
Matthew Williams
Geodesic GraFX
www.geodesicgrafx.com/blog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288851
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4