I have a table on which I am using the jQuery UI "sortable". The table has rows consisting of a “drag marker” to capture and reorder the table, and cells with interactive elements, for example:
<table id="test-table">
<tbody>
<tr>
<td class="handle"><div class="ui-icon ui-icon-arrowthick-2-n-s" /></td>
<td class="clickycell"><a href="#">Testing 1</a></td>
</tr>
<tr>
<td class="handle"><div class="ui-icon ui-icon-arrowthick-2-n-s" /></td>
<td class="clickycell"><a href="#">Testing 2</a></td></td>
<tr>
<td class="handle"><div class="ui-icon ui-icon-arrowthick-2-n-s" /></td>
<td class="clickycell"><a href="#">Testing 3</a></td></td>
</tr>
</tbody>
</table>
In my code, I make the table sortable, and also use jQuery live()to bind the click event to the elements activated by the click, for example:
$(function() {
$(".clickycell a").live('click', function() {
alert("Successful click");
return false;
});
$("#test-table tbody").sortable({
handle: "td.handle",
cursor: "move"
});
});
I use it live()because rows can be dynamically added to a table in real code.
: , . , , , , . , , " ", , .
click() live() - - , live(), . , .
jsFiddle. , "...". , Firefox , " ".
?