DataTables not displaying CakePHP JSON table data

DataTables not displaying CakePHP JSON table data

jimvjimv Posts: 27Questions: 0Answers: 0
edited March 2012 in General
I'm working on a new application, using CakePHP to produce the JSON data for DataTables, but am unable to get DataTables to display the data.

Source of the data is : http://wwwtest.registrar.wisc.edu/Posts/datatable

That data passes JSON validation.

If I copy the text from that page, and put it in to a new text file, http://wwwtest.registrar.wisc.edu/test_array.txt, DataTables is able to correctly parse/display the data.

Test page is located here: http://wwwtest.registrar.wisc.edu/DT_Test.htm

JavaScript is:

[code]

$(document).ready(function() {
$('#post_data').dataTable( {
"sAjaxSource": "/Posts/datatable"
} );
} );

[/code]

I'm sure I'm missing something simple, but just can't see what it is.
Any suggestions on why DataTables is not able to work with the CakePHP produced JSON?
Does anyone have the source for a CakePHP app that they have working that they woudl be willing to share?
Thanks
Jim

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    [quote]
    Posts/datatable?_=1333127990078
    Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    [/quote]

    That's not going to help. Have a look in your server's error logs.

    Allan
  • jimvjimv Posts: 27Questions: 0Answers: 0
    Allan,
    Thanks for the quick reply!
    That page loads fine for me, I checked it in multiple browsers/computers.
    Also, was there a reason it had a parameter "?_=1333127990078" when you tried it??

    I did check the error log, no error.

    Thanks
    Jim
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    I've just tried again and I'm still getting a 500 error. Perhaps it is because I'm off site?

    > Also, was there a reason it had a parameter "?_=1333127990078" when you tried it??

    That's the jQuery anti-cache parameter - http://jqapi.com/#p=jQuery.ajax

    Allan
This discussion has been closed.