Trying to add a row throws me the following error:
DataTables warning: table id = table - Request unknown parameter 'name' for row 0, column 1. For more information about this error, please see link
This is the datatables code
$(document).ready(function(){
var table = $('#table').DataTable({
"responsive": true,
"processing": true,
"serverSide": true,
"ajax": "tabla/cargos",
"columns": [
{
sortable: false,
"render": function ( data, type, full, meta ) {
return meta.row+1;
}
},
{data: 'nombre'},
{
sortable: false,
"render": function ( data, type, full, meta ) {
return '<button class="edit-modal btn btn-info" data-id="'+full.id+'" data-nombre="'+full.nombre+'">'+
'<span class="fa fa-edit"></span> Editar'+
'</button> '+
'<button class="delete-modal btn btn-danger" data-id="'+full.id+'" data-nombre="'+full.nombre+'">'+
'<span class="fa fa-trash"></span> Eliminar'+
'</button>'
;
}
},
],
"language": idioma_español
});
new $.fn.dataTable.FixedHeader( table );
$('#addRow').on( 'click', function () {
table.row.add( [
'10',
'Prueba',
'Botones'
] ).draw( false );
} );
// Automatically add a first row of data
$('#addRow').click();
});