Show extra information, version datatable 1.10.10
Show extra information, version datatable 1.10.10
ArmandArthur
Posts: 10Questions: 2Answers: 0
Hello,
I have this link: https://datatables.net/examples/api/row_details.html and i would like my code works with the version 1.10.10.
But the function "row" doesn't work with 1.10.10
Could you help me to find a solution please?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
What DataTables version are you using?
API method
row()
is available since version 1.10.0 and should be available in 1.10.10 as well.See more articles about jQuery DataTables on gyrocode.com.
My version is 1.10.10.
var table = $('#example').DataTable( {
"ajax": "../ajax/data/objects.txt",
"columns": [
{
"className": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{ "data": "name" },
{ "data": "position" },
{ "data": "office" },
{ "data": "salary" }
],
"order": [[1, 'asc']]
} );
Which is the equivalent with aoColumnDefs instead of columns?
Because when i use columms i have this message :
Cannot read property 'mData' of undefined
This page has the parameter naming conversion chart:
https://datatables.net/upgrade/1.10-convert
Do you have 5 columns defined in your table in HTML?
Kevin
I have more, 6 columns.
You defined only 5 columns. With
columns
you need to define something for each existing column. That is why you are seeing theCannot read property
error.Kevin
Yes thanks your for the config but i have the message "row" is not a function.
I need to convert the functions of the link which i had pasted here?
Please show your code where you use
row()
method.See more articles about jQuery DataTables on gyrocode.com.
This is the code of the exemple
$('#example tbody').on('click', 'td.details-control', function () {
var tr = $(this).closest('tr');
var row = table.row( tr );
And this is the code modified by me
This line:
is not the same as:
Consider using the code below instead:
See more articles about jQuery DataTables on gyrocode.com.
I changed datatable by Datatable and it's works!