I just tried it and it worked fine. My guess is you don't properly close
tags inside your table. Here's what I just did and it worked fine:

<table border="1">
   <tr>
       <td>Some Data</td>
       <td><a href="#">Foo</a></td>
   </tr>
   <tr>
       <td>Some Data 2</td>
       <td><a href="#">Foo</a></td>
   </tr>
</table>

$(function() {
     $('table a').click(function() {
         $(this).ancestors('tr').hide();
     });
});


--Erik


On 11/27/06, Bruce MacKay <[EMAIL PROTECTED]> wrote:

 Thanks Erik,

Unfortunately your line of code hid all the rows in the table, including
the one that was clicked.  If I just wanted to hide the row that was
clicked, how would your line be altered?

Bruce



At 10:38 a.m. 28/11/2006, you wrote:

$("tr").hide() matches all tr tags and hides them. If you want to hide the
tr that contained the link that was clicked, you might try something like
this:

$("#tbl_assetList a").click(function(){$(this).ancestors("tr").hide()});

That will hide all the TR tags that are "up" the DOM tree from the clicked
link. That may have undesirable affects if you have nested tables, but that
could be worked around.

--Erik

On 11/27/06, *Bruce MacKay* <[EMAIL PROTECTED]> wrote:
 Hi folks,

I have a tabulated set of data (table id=tbl_assetList), with the last
column of each row providing a "delete it" link to the following function...

function fnDeleteNodeTransaction(ni,pi,ai){
    $("#theIndicator3").show();
    $("#tbl_assetList a").click(function(){$("tr").hide()});

$.get("scripts/ajax_ramosus_editor.asp?id=4&pblID="+pi+"&iAssetID="+ai+"&nodeID="+ni,
function(responseText){

$("#currentAssetsTable").html(responseText).highlightFade({color:'yellow',speed:2000,iterator:'sinusoidal'});
        $("#theIndicator3").hide();
    });
}

 My attempt at hiding the deleted item's row (line 3)  is successful in
hiding the entire table for reasons that are not obvious to me, but I
suspect are clearly obvious to you.

I'd appreciate some illumination here.

Thanks,

Bruce

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



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


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



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

Reply via email to