How can I get alternative pagination working with the initialization of editor?
How can I get alternative pagination working with the initialization of editor?
AlexDTables
Posts: 19Questions: 3Answers: 0
I have tried different ways, but if I write on of these code snippets, I always get the error messages ".. Cannot reinitialise Editor..."
// OPTION A
$(document).ready(function() {
$('#contactos').DataTable( {
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
} );
// OR OPTION B
$(document).ready(function() {
$('#example').DataTable( {
"pagingType": "full_numbers"
} );
} );
// OPTION C
// Right now I'm trying with following code, but nothing happens:
var table2 = $('#contactos').DataTable( {
'pagingType':'full_numbers', // Is here the right place for the pagging type?
dom: 'Bfrtip',
ajax: 'php/table.contactos.php',
columns: [
{
"data": "contactos.nombre"
},
{
"data": "contactos.telefono_fijo"
},
{
"data": "contactos.telefono_cel"
},
{
"data": "contactos.email"
},
{
"data": "clientes.nombre_comercial"
}
],
select: true,
lengthChange: true,
buttons: [
{ extend: 'create', text: "Nuevo", editor: editor },
{ extend: 'edit', text:"Editar", editor: editor },
{ extend: 'remove', text:"Eliminar", editor: editor }
]
} );
Please help on get the alternative paggination for my tables.
Thanks in advance!
This discussion has been closed.
Replies
Do you mean, "Cannot reinitialise DataTables" (rather than Editor)? If so, please see this document. Basically you need to combine your individual initialisation blocks into one. There is an example in the documentation.
Allan
I should also comment on this bit:
Yes it is. If that isn't working for you, please link to a test case showing the issue.
Allan
Ok, It was only necessary to remove the following line: