Reputation: 7768
Here is my table
<table class="sortable">
<tr class="sort_tr">
<td>
<table>
<tr><td>data sub1</td></tr>
<tr><td>data sub2</td></tr>
</table>
</td>
</tr class="sort_tr">
<tr>
<td>data2</td>
</tr>
And my script for make this table sortable is as follows,
<script>
$(function() {
$( ".sortable" ).sortable({items:'tr'});
});
</script>
I want to sort only the child tr of table with class "sortable".but now it is able to sort tr of child table.How to disable sorting of child?
Upvotes: 0
Views: 315
Reputation: 1007
Do you want this kind of functionality
then i used :not()
selector for it
here i made the selection of all <tr>
in sortable
class except for the table
and tr
in the sortable
class
Edited: Check this edited demo, is this what you want --> Updated demo
Upvotes: 2