Maybe I should have mentioned this, but in my case, I'm using
hoverIntent, trying to write a sort of flyover context menu for each
table row.  Is the event object and it's target and so on available to
me in the callback functions?  I wish I actually knew what I was
doing...

Nat

On Nov 9, 8:17 am, Suni <[EMAIL PROTECTED]> wrote:
> Wouldn't it be best (bug or no bug) to just bind the event to the
> tbody or table element, and check the clicked row from event.target?
> This method only needs one event handler binding regardless of the
> number of rows (so performance is better), it works even when you add
> rows dynamically, and it doesn't matter if tablesorting does something
> with the rows.
>
> Quick code example follows (remove a table row when clicked):
>
> HTML:
> <table id="myTable">
>   <tbody>
>     <tr>
>       <td>foo bar </td>
>     </tr>
>     <tr>
>       <td>foo bar </td>
>     </tr>
>     <tr>
>       <td>foo bar </td>
>     </tr>
>   </tbody>
> </table>
>
> Javascript (place in $(document).ready(function() { ... } ); )
>
> $('#myTable tbody').bind('click',function(e)
> {
>    var clicked_row = $(e.target).parent(); // Get the parent, since
> e.target points to the td-element
>    clicked_row.remove();
>
> });

Reply via email to