Remove aoColumns
Remove aoColumns
hi
on http://live.datatables.net/ i tested this
[code]
// Server-side processing with POST
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bLengthChange": true,
"bSort": false,
"bInfo": false,
"iDisplayLength": 10,
"bPaginate": true,
"bAutoWidth": true,
"bServerSide": true,
"sDom": '<"#thead"f>tipr',
"ajax": "/ssp/objects.php",
"aoColumns": [
{ "sTitle": "Firstname", "mData": "first_name" },
{ "sTitle": "Lastname", "mData": "last_name" },
{ "sTitle": "Office", "mData": "office" },
{ "sTitle": "Position", "mData": "position" },
{ "sTitle": "Salary", "mData": "salary" },
{ "sTitle": "Start date", "mData": "start_date" },
]
} );
} );
[/code]
[code]
<!DOCTYPE html>
DataTables - JS Bin
Name
LastName
Office
Position
Salary
Start date
[/code]
if i removed aoColumns i get
[quote]
DataTables warning: table id=example - An SQL error occurred: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 10' at line 5
[/quote]
if i put bsort to true and remove aoColumns i get
[quote]
DataTables warning: table id=example - Requested unknown parameter '0' for row 0. For more information about this error, please see http://datatables.net/tn/4
[/quote]
how to avoid to use aoColumns?
on http://live.datatables.net/ i tested this
[code]
// Server-side processing with POST
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bLengthChange": true,
"bSort": false,
"bInfo": false,
"iDisplayLength": 10,
"bPaginate": true,
"bAutoWidth": true,
"bServerSide": true,
"sDom": '<"#thead"f>tipr',
"ajax": "/ssp/objects.php",
"aoColumns": [
{ "sTitle": "Firstname", "mData": "first_name" },
{ "sTitle": "Lastname", "mData": "last_name" },
{ "sTitle": "Office", "mData": "office" },
{ "sTitle": "Position", "mData": "position" },
{ "sTitle": "Salary", "mData": "salary" },
{ "sTitle": "Start date", "mData": "start_date" },
]
} );
} );
[/code]
[code]
<!DOCTYPE html>
DataTables - JS Bin
Name
LastName
Office
Position
Salary
Start date
[/code]
if i removed aoColumns i get
[quote]
DataTables warning: table id=example - An SQL error occurred: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 10' at line 5
[/quote]
if i put bsort to true and remove aoColumns i get
[quote]
DataTables warning: table id=example - Requested unknown parameter '0' for row 0. For more information about this error, please see http://datatables.net/tn/4
[/quote]
how to avoid to use aoColumns?
This discussion has been closed.
Replies
It looks like there is an error in my PHP scripts if you use:
[code]
"bSort": false,
[/code]
I'll look into this and get a fix committed. Thanks for flagging it up.
Allan
Example: http://live.datatables.net/fiwajay/1/edit
Allan