I'm working on project which will have a table of information. For any row,
there could be more "more information" that the user may want to view. Any
row with more information would have some sort of image indicating this.
When the user clicks the row, I'd like to pull data using AJAX, then expand
the row via a callback function.
 
Here's how I might do it, does anyone have a better solution?
 
<table border="1" width="400">
<tr id="methodname|123456" class="row">
 <td>Name</td>
 <td>Address</td>
 <td><img src="moreinfo.gif" name="image1" /></td>
</tr>
<tr id="row1details" style="display: none;">
 <td colspan="3">
  additional details would go here<br />
  additional details would go here<br />
  additional details would go here<br />
  additional details would go here<br />
  additional details would go here<br />
 </td>
</tr>
</table>
 

 $(document).ready( function(){
 
  $('.row td img').bind("click", function() {
   $('#row1details').slideDown("slow");
  });
 
 });
 
The first problem with this is that the TR doesn't animate. It merely shows,
even though I'm using slideDown. What am I doing wrong there?
 
I'm not even sure how to do the AJAX call. For any row which has more
information, I need to pass in two values...a string representing a
Coldfusion method to call, and a number representing the id of the record I
want to return to the page. I think the easiest way to do this would be to
stash the methodname and number (id) as the id of the row, then parse that
in the click function. I think I can figure out that part.
 
Another question I have is in the above example, when I click the img, I
need to be able to get the ID of it's parent TR. I thought that this would
work:
 
 $('.row td img').bind("click", function() {
  this.parent('tr').attr('id');
 });
 
 But it returns an error saying "Object doesn't support this property or
method.". What am I doing wrong?
 
 Please feel free to answer any one of these questions...
 
____________________________________
 
Andy Matthews
Senior Coldfusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com <http://www.dealerskins.com/> 
 

Attachment: dealerskinslogo.bmp
Description: Windows bitmap

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to