"render": function ( data, type, row ) { // Bitcointalk //nu
"render": function ( data, type, row ) { // Bitcointalk //nu
Hi,
I try to custom a cell of my datatable with "render". That's work fine but I've an alert error when I load the table:
"DataTables warning: table id=data_index - Requested unknown parameter '7' for row 0, column 7"
Here my datatable declaration:
$(document).ready(function() {
$('#data_index').DataTable( {
"ajax": 'data_index.php',
"iDisplayLength": 100,
"columnDefs": [
{
"render": function ( data, type, row ) {
if(data > 0)
return row[7]+"%";
},
"targets": [ 7 ]
}
]
} );
} );
Here my JSON:
{
"draw":1,
"recordsTotal":0,
"recordsFiltered":0,
"data":[
[
1,
"bitcoin",
"Bitcoin",
"3567.06",
"59112700000",
"0.23",
0,
0,
0,
"https:\/\/www.reddit.com\/r\/Bitcoin\/",
"326400",
923,
"Bitcoin",
"325888",
906
]
]
}
Do you have an idea ?
Answers
Do you have any idea what's wrong?
Please don't post duplicate questions. @allan already answered your question in this post:
https://datatables.net/forums/discussion/44730/requested-unknown-parameter#latest
Did you try his solution?
Kevin