Delete database record with ajax + spring boot + thymeleaf

0

Good afternoon! I'm trying to delete an item in my view, which is in a bootstrap table. I'm using thymeleaf + bootstrapno frontend. The idea is to take the id and move to a modal bootstrap window and through the modal delete the record in the bank. But I am not able to pass the id to the ajax function to delete the record. Can someone help me? x.x

Follow the code snippets - >

link

    
asked by anonymous 19.05.2017 / 20:54

1 answer

0
  

If it has not resolved yet, I did so see if it helps.

$('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget);

var Codigo = button.data('codigo');
var Nome = button.data('nome');

var modal = $(this);
var form = modal.find('form');
var action = form.data('url-base');
if (!action.endsWith('/')) {
    action += '/';
}
form.attr('action', action + Codigo);

modal.find('.modal-body span').html('Tem certeza que deseja excluir :  

<strong>' + Nome + '</strong>?');
});
    
26.05.2017 / 00:36