I'm doing a datatable with ajax return.
$.getJSON("sql.php?operacao=usuario_lista&excluidos=false", function (data) {
alert(data.users);
$('#tabusuarios').DataTable({
"aaData": data.users,
"aoColumns": [
{ "mDataProp": "ID" },
{ "mDataProp": "NOME" },
{ "mDataProp": "USUARIO" }
]
});
});
My JSON returns:
{
"users": [
{
"ID": "89",
"NOME": "aaabbbb",
"USUARIO": "a.b",
"DTNASC": "2017-01-01",
"NUM": "112233"
},
{
"ID": "76",
"NOME": "Bruno Pereira",
"USUARIO": "brunopereira",
"DTNASC": "2011-01-01",
"NUM": "11"
}
]
}
But he gives the error:
DataTables warning: table id = tabusers - Can not reinitialise DataTable. For more information about this error, please see link
And do not populate the table ..