Specifying Columns with AJAX Source doesn't work

Specifying Columns with AJAX Source doesn't work

DigicratDigicrat Posts: 3Questions: 0Answers: 0
edited May 2012 in General
I have a PHP script which is returning the aaData and aaColumns data to create a table, with the specified titles. Using the code below I get an error that oColumn is undefined (with a blank table):
[code]
$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": 'script.php'
} );
[/code]

As a workaround, I am instead successfully using:
[code]
$.getJSON('script.php',
{},
function(data) {
$('#example').dataTable( data );
});
[/code]


Is there a reason why the JSON call can't accept a list of columns in the same format as a direct call? Or is there a different format that's preferred for specifying table columns in the JSON object? If not, I humbly suggest adding this as an option in the next release.
This discussion has been closed.