Thomas_Jung
Erfahrenes Mitglied
Hallo,
ist es möglich das man nur an einer Stelle die Liste (li) sortiern kann.
Gruß Thomas
ist es möglich das man nur an einer Stelle die Liste (li) sortiern kann.
Gruß Thomas
HTML:
<ul class="list-unstyled" id="page_list">
<li id="1">
<table width="100%" border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td>Text 1 NUR hier soll man die (li) Sortieren können</td>
<td>Text 2 Hier NICHT</td>
<td>Text 3 Hier NICHT</td>
</tr>
</tbody>
</table>
</li>
<li id="2">
<table width="100%" border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td>Text 1 NUR hier soll man die (li) Sortieren können</td>
<td>Text 2 Hier NICHT</td>
<td>Text 3 Hier NICHT</td>
</tr>
</tbody>
</table>
</li>
</ul>
Code:
$(document).ready(function(){
$( "#page_list" ).sortable({
placeholder : "ui-state-highlight",
update : function(event, ui)
{
var page_id_array = new Array();
$('#page_list li').each(function(){
page_id_array.push($(this).attr("id"));
});
$.ajax({
url:"update.php",
method:"POST",
data:{page_id_array:page_id_array},
success:function(data)
{
alert(data);
}
});
}
});
});