2
Every time I make a change in select it calls this function, it takes the id of the selected tax and does the research by (daughters) tax rules, I need to update the table every time it changes but this error happens: Datatables Warning: table id=regrasimpostos - Cannot reinitialise Datatable. For more information about this error, Please see http://datatables.net/tn/3
function pesquisaRegrasImpostos(imposto){
if (imposto != "") {
$.ajax({
url: `/pesquisa/regraimposto/${imposto}`,
success: function(data){
$("#regrasimpostos").DataTable({
"processing": true,
"serverSide": true,
"ajax": `/pesquisa/regraimposto/${imposto}`,
"columns": [
{"data" : "impostoNome"},
{"data" : "modelo"},
{"data" : "pessoa"},
{"data" : "contribuinte"},
{"data" : "estado"},
{"data" : "cfop"},
{
"data" : null,
defaultContent: `<a href="#" title="Editar" data-id="impostoID" onclick="editarRegra('variavel')"><i class="edit icon"></i></a>`
}
]
})
},
error: function(error){
alert(JSON.stringify(error));
}
});
}
}
If the datatables is
1.10.xxx
can add the optiondestroy: true,
in the builder.– Roberto Braga