No me aparecen los botones de acciones "create", "edit" y "remove"
No me aparecen los botones de acciones "create", "edit" y "remove"
Luna.taptap
Posts: 1Questions: 1Answers: 0
editor = new $.fn.dataTable.Editor( {
ajax: "controllers/productos.php",
table: "#tablaProductos",
fields: [ {
label: "Nombre:",
name: "nombre"
}, {
label: "Precio:",
name: "precio"
}, {
label: "Existencia:",
name: "existencia"
}, {
label: "Imagenes:",
name: "files[].id",
type: "uploadMany",
display: function ( fileId, counter ) {
return '<img src="'+editor.file( 'files', fileId ).web_path+'"/>';
},
noFileText: 'No hay imagenes'
}
]
} );
$('#tablaProductos').DataTable( {
dom: "Bfrtip",
ajax: "controllers/productos.php",
columns: [
{ data: "nombre" },
{ data: "precio", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) },
{ data: "existencia" },
{
data: "files",
render: function ( d ) {
return d.length ?
d.length+' imagen(es)' :
'No hay imagen(es)';
},
title: "Imagen"
}
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Answers
Your data table definition looks ok. What error message are you getting?
Also, have you included the Editor source files in your page? It would be worth confirming in the browser's developer tools in case there's a load order issue.
Colin