TypeError: table.row is not a function
TypeError: table.row is not a function
mldgato
Posts: 13Questions: 3Answers: 0
Hi, I have the following error: TypeError: table.row is not a function
I'm trying to add a button in each column to modify different things, I'm following this example:
https://datatables.net/examples/ajax/null_data_source.html
My javascript code is as follows:
$(document).ready(function()
{
var table = $('#LosUsuarios').dataTable(
{
"language":
{
"url": "//cdn.datatables.net/plug-ins/1.10.12/i18n/Spanish.json"
},
"ajax":
{
"url": "usuarios/listadoUsuarios.php",
"type": "POST"
},
"columns": [
{ "data": "Nombres" },
{ "data": "Apellidos" },
{ "data": "Usuario" },
{ "data": "Email" },
{ "data": "NombreRol" },
{'defaultContent': '<button id="AdminUser" class="btn btn-success btn-sm">Editar <span class="glyphicon glyphicon-pencil"></span></button>'}
]
});
$('#LosUsuarios tbody').on('click', '#AdminUser', function()
{
var data = table.row($(this).parents('tr')).data();
alert(data[0]);
});
});
You can see my table in the following link
sigeco.manueldardon.net/prueba.php
Thank you very much for the help
This discussion has been closed.
Replies
Its the top FAQ ;-)
Allan