I have a table, which I include the data dynamically in a table. I include in this way, I include in the first column the checkboxes:
$("#tablepesquisaprodutos").append("<tr class='item'>"
+ "<td>" + "<input type='checkbox' class='link-check' />" + "</td>"
+ "<td>" + CodigoProduto + "</td>"
+ "<td>" + DescricaoProduto + "</td>"
+ "</tr>")
It works perfectly, but I need to checkbox, I can delete or edit the line (opening a modal with the line data), how can I do it? Delete I get by a button, I do it this way:
$(function () {
$(document).on('click', '.link-excluir', function (e) {
e.preventDefault(); // isso aqui impede do '#' fazer o link pular
var $el = $(this);
$el.closest("tr").fadeOut(500, function () {
$el.remove();
})
})
})
In case I have the link to delete on the line, I need to select the line, and then click the action button, or delete or change.