DataTables warning: table id=tableRoles - Invalid JSON response.

DataTables warning: table id=tableRoles - Invalid JSON response.

Berenice_VelascoBerenice_Velasco Posts: 1Questions: 1Answers: 0

hola

tengo este problema, no me muestra los registros y sale este mensaje.

DataTables warning: table id=tableRoles - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

ya revise el codigo varias veces pero no encuentro el error, podran ayudarme.

aqui el codigo

var tableRoles;
document.addEventListener('DOMContentLoaded', function() {
tableRoles = $('#tableRoles').dataTable({
"aProcessing": true,
"aServerSide": true,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.20/i18n/Spanish.json"
},
"ajax": {
"url": " " + base_url + "/Roles/getRoles",
"dataSrc": ""
},
"columns": [
{"data": "idrol"},
{"data": "nombrerol"},
{"data": "descripcion"},
{"data": "status"}
],
"responsieve": "true",
"bDestroy": true,
"iDisplayLength": 10,
"order": [
[0, "desc"]
]
});
});

//----------------------------------------------------------------
$('#tableRoles').DataTable();

function openModal(){
$('#modalFormRol').modal('show');
}

Answers

This discussion has been closed.