Server-side not working with same json result

Server-side not working with same json result

beckenkampbeckenkamp Posts: 3Questions: 0Answers: 0
edited September 2011 in General
Hello.

I am using datatables for a while, but now I am trying the server-side processing feature. Everything was ok when I use de PHP example from the DataTables website. Then I made some changes and still everything is working fine.

But now, I created a code that does exactly same as the old one. The return is identical! But all I have is an empty table, with no erros and anything like this, just an empty table.

The only difference is that I used direct script in the first time and in the second it was inside a Codeigniter controller class. So in the first try (that works) I called it with something like "{base url}/datatable.php" and in the second one like this "{base url}/datatable/table".

Note: the Json returns are exactly the same in both cases!!

Anyone can help me?

Replies

  • GregPGregP Posts: 500Questions: 10Answers: 0
    The JSON may return the same when executing the script itself, but I would be curious to see what the response looks like in a debugging tool like Firebug.
  • beckenkampbeckenkamp Posts: 3Questions: 0Answers: 0
    Hi, GregP!
    Thanks for the answer.

    I've tried to use the $.getJSON jquery function to debug, and it returns the same result too.
    Is there another way to debug the Json response that 'server-side processing' sends?
  • GregPGregP Posts: 500Questions: 10Answers: 0
    Using a test .getJSON() function should work, but it's not necessary if you start debugging with Firebug (a Firefox add-on). In Firebug, you just switch to console view, and when dataTable() is called, you'll see the GET request with a [+] icon next to it. Expand it and you can dig into the parameters, the raw string response (useful for cutting and pasting to jsonlint.com by the way!), and also a JSON view that you can drill into with further [+] icons.
  • beckenkampbeckenkamp Posts: 3Questions: 0Answers: 0
    Thank you very much, GregP!

    You were absolutely right about it! The response now is very different and I'll find my mistakes!

    I didn't know the really power of console feature on firebug! ;P
This discussion has been closed.