DataTable onClick Uncaught TypeError: table.row(...).data is not a function
DataTable onClick Uncaught TypeError: table.row(...).data is not a function
SilverEdition
Posts: 1Questions: 1Answers: 0
When using ServerSide: ture and Processing: true on button click I get:
Uncaught TypeError: table.row(...).data is not a function
$("#table").DataTable({
bProcessing: true,
bServerSide: true,
ajax: {
url: "/data/users",
type: "post"
},
select: true,
columns: [
{ data: "Name", title: "Name" },
{ data: "Surname", title: "Surname" },
{ data: null, title: "Edit", "defaultContent": "<button>Edit</button>" }
]
});
$("#table").on('click', 'button', function() {
var data = table.row($(this).parents('tr')).data();
});
This discussion has been closed.
Answers
I don't see where the variable
table
is being assigned. Is the code above incomplete, or is that the error? Can you please link to a test case, as per the forum rules.Allan