0
I have a table that shows student records, and each row has a button to delete the student, and the deletion is done via AJAX. I would like to fadeOut the line that is deleted, so in AJAX Success I did the following:
success:function(){
swal("Excluído!", "O aluno foi removido com sucesso.", "success");
btnExcluir.closest('tr').fadeOut();
}
The problem is that all lines are being removed. I also tried with Parent(). Parent() but still the same occurs.
Follow the excerpt from my table:
<tr>
<td>{{$aluno['NM_NIS_ALU']}}</td>
<td>{{$aluno['ST_NOME_ALU']}}</td>
<td class="text-right">{{$aluno['IDADE']}}</td>
<td class="text-center">
<a class="btn btn-primary btn-xs acao" data-toggle="modal" data-target="#modalAluno{{$aluno['ID_ALUNO_ALU']}}"><i class="fa fa-edit"></i> Editar</a>
<a class="btn btn-danger btn-xs acao delete-aluno" data-token="{{csrf_token()}}" data-id="{{$aluno['ID_ALUNO_ALU']}}"><i class="fa fa-times"></i> Excluir</a>
</td>
</tr>
If anyone can help me, why is this occurring?
It worked! Thank you very much, friend!
– Matheus