JSFiddle - React, Tailwind, and code Playground
HTML
<div id="widget_update">
<div id="Fahrzeuge" /><img src="/admin/images/arrow.png" alt="move" width="16" height="16" class="handle" />
<table width="538" cellspacing="0" cellpadding="0" border="0" >
<tr>
<td id="fahrzeuge">
</td>
</tr>
</table>
</div>
<div id="NEWS" /><img src="/admin/images/arrow.png" alt="move" width="16" height="16" class="handle" />
<table width="538" cellspacing="0" cellpadding="0" border="0">
<tr>
<td id="news">
</td>
</tr>
</table>
</div>
</div>
JavaScript
$("#widget_update").sortable({
update : function(event, ui) {
var widget = $('#widget_update').sortable('serialize');
alert(ui.item[0].id);
$.ajax({
type: "POST",
url: "ajax/dashboard.php",
dataType : 'json',
cache: false,
data: {'position' : ui.item.index(),'item':ui.item[0].id},
success: function(data){
$('#widget').html(data.html);
},
error: function(data){
alert('Error');
}
});
}
});