Ajax source does not load any table records

Ajax source does not load any table records

HeavyChevyHeavyChevy Posts: 7Questions: 0Answers: 0
edited October 2011 in DataTables 1.8
Hello Allan and others,

I have been trying for a few days now to get server-side processing to work using the examples on the Data Tables web site but have had no luck. Here is a snippet from the table initialization:


$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bProcessing": false,
"sAjaxSource": "server_processing.php"
} );
} );


I am using the script "server_processing.php" from the example modified to show my own table (5 colums, 5 rows). When run on localhost using Chrome, it shows the following json output:

{"sEcho":0,"iTotalRecords":"5","iTotalDisplayRecords":"5","aaData":[["14","ARGTM","200.49.206.64\/27","Ed","2011-10-10 11:41:42"],["15","BRACL","55928401","Ed","2011-10-10 11:42:09"],["16","FINTA","87.94.165.0\/24","Ed","2011-10-10 11:43:05"],["17","USAAT","1989707","Ed","2011-10-10 11:47:28"],["18","USACG","1989707","Ed","2011-10-10 11:47:38"]]}

I have validated this with JSONLint and it is valid.

I also cut and pasted this JSON output into a file and used that as sAjaxSource but the results are the same. Thinking maybe it was Chrome I also tried Firefox with the same result.

The DataTables shows "loading" forever and never loads the data. If i click on one of the column headings I get "no data in table" message.

This is probably a simple error on my part but nothing I try seems to work.

The HTML looks like this (I just changed the column names to match my table):





relationshipId
pmnCode
ggsnIP
lastUpdUser
lastUpdDate







relationshipId
pmnCode
ggsnIP
lastUpdUser
lastUpdDate

Replies

  • HeavyChevyHeavyChevy Posts: 7Questions: 0Answers: 0
    OK I have resolved the problem...ran the code under firefox/firebug and it pinpointed a json error. I had a script include pointing to an old copy of json, removing the include defaulted to the proper version. Had to learn firebug (not too bad) to get it!
This discussion has been closed.