I have a ajax code that sorts items from my table, what I need is for it to refresh only the div
ID Image Name Slug Order Situation Action
<tbody>
<?php
foreach ($list as $row) {
?>
<tr id="acomodacaoArray_<?=$row['id']?>">
<td><?php echo $row['id']; ?></td>
<td>
<?php
if($row['imagem']=='') {
echo '<img src="../img/sem-imagem.jpg" width="50">';
} else {
echo '<img src="../img/acomodacoes/'.$row['imagem'].'" width="50">';
}
?>
</td>
<td><?php echo $row['nome_br']; ?></td>
<td><?php echo $row['slug']; ?></td>
<td><?php echo $row['ordem']; ?></td>
<td>
<?php
if($row['situacao']=='Ativo') {
echo '<span class="badge p-2 badge-success">ATIVO</span>';
} else {
echo '<span class="badge p-2 badge-danger">INATIVO</span>';
}
?>
</td>
<td>
<a href="acomodacao-editar.php?id=<?php echo $row['id']; ?>" class="btn btn-primary btn-sm"><i class="fe-edit-2"></i> Editar</a>
<a href="#" class="btn btn-danger btn-sm" data-href="acomodacao-apagar.php?id=<?php echo $row['id']; ?>" data-toggle="modal" data-target="#confirm-delete"><i class="mdi mdi-delete"></i>Apagar</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
$(document).ready(function(){
$(function() {
$("table tbody").sortable({ opacity: 0.6, cursor: 'move', update: function() {
var order = $(this).sortable("serialize");
$.ajax({
url: 'ordem-acomodacoes.php?action=atualizaordem',
type: 'POST',
data: order,
success: function(data) {
}
});
}
});
});
});