Requested unknown parameter '0' for row 0, column 0 ...
When trying to implement checkboxes in the first column with serverside processing.
Here is the code
var table = $('#table-keys').DataTable({ 'processing': true, 'serverSide': true, 'columnDefs': [ { 'targets': 0, 'checkboxes': { 'selectRow': true } } ], 'ajax': 'post/dt_fingerprint.php', 'select': { 'style': 'multi' }, 'order': [[1, 'asc']] });
And here is the php file dt_fingerprint:
`
// Table's primary key
$primaryKey = 'id';
// Array of database columns which should be read and sent back to DataTables.
// The db parameter represents the column name in the database, while the dt
// parameter represents the DataTables column identifier. In this case simple
// indexes
$columns = array(
array( 'db' => 'id', 'dt' => 1 ),
array( 'db' => 'name', 'dt' => 2 ),
array( 'db' => 'fingerprint', 'dt' => 3 ),
);`
and here is the html file that has the table:
`
`
The code works, and by that I mean I get the table to work and the checkboxes to work. However, I constantly get the following error before the table loads.
> DataTables warning: table id=table-keys - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4
I realise the error might be due to the extra column (column 0) but I don't know how to tell datatable to ignore it
Help
I'm currently using these script tags:
`
`
I get the datatable error
When trying to implement checkboxes in the first column with serverside processing. Here is the code
var table = $('#table-keys').DataTable({ 'processing': true, 'serverSide': true, 'columnDefs': [ { 'targets': 0, 'checkboxes': { 'selectRow': true } } ], 'ajax': 'post/dt_fingerprint.php', 'select': { 'style': 'multi' }, 'order': [[1, 'asc']] });
And here is the php file dt_fingerprint:
` // Table's primary key $primaryKey = 'id';
// Array of database columns which should be read and sent back to DataTables. // The
db
parameter represents the column name in the database, while thedt
// parameter represents the DataTables column identifier. In this case simple // indexes $columns = array( array( 'db' => 'id', 'dt' => 1 ), array( 'db' => 'name', 'dt' => 2 ), array( 'db' => 'fingerprint', 'dt' => 3 ),);`
and here is the html file that has the table:
`
` The code works, and by that I mean I get the table to work and the checkboxes to work. However, I constantly get the following error before the table loads. > DataTables warning: table id=table-keys - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4 I realise the error might be due to the extra column (column 0) but I don't know how to tell datatable to ignore it Help I'm currently using these script tags: ` `