server side processing: processing indicator continues to show though the ajax response was received

server side processing: processing indicator continues to show though the ajax response was received

hanifnghanifng Posts: 3Questions: 0Answers: 0
edited December 2011 in DataTables 1.8
hi all,

I've got some problem here and need a help,
at the first time fetching the data from server, there was no problem
but if I try to sort the data (and filter them), the processing indicator continues to show even though the ajax response has been received successfuly [200 OK] and no parsing error shown. [and of course the data is not updated]

here's the script on my html page:
[code]



ID
Filename
Filesize







<!-- // <![CDATA[
var oTable;
oTable = $('#filelist').dataTable({
"bProcessing":true,
"bServerSide":true,
"sAjaxSource":"http:\/\/localhost\/apps\/damsf\/public_html\/file\/admin\/index.json",
"aaSorting":[[0,"desc"]],
"aoColumns":[{"sName":"id","sTitle":"ID"},{"sName":"filename","sTitle":"Filename"},{"sName":"filesize","sTitle":"Filesize"}],
"aoData":[{"sWidth":"25px","bSortable":true},{"sWidth":"300px","bSortable":true},{"sWidth":"","bSortable":true}]
});
// ]]> -->

[/code]
ajax response (from firebug):
[code]
{
"sEcho":1,
"iTotalRecords":2,
"iTotalDisplayRecords":2,
"aaData":[
["1","abstraction-rev2.docx","1843053"],
["2","report-nov-2011.pdf","399034"]
]
}
[/code]
the response header:
[code]
HTTP/1.1 200 OK
Date: Sat, 03 Dec 2011 12:20:30 GMT
Server: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
X-Powered-By: PHP/5.3.5 ZendServer
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json
[/code]

any help would be appreciated :)
thank you guys..

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Any Javascript errors on the Firebug or Inspector consoles? If not, can you give us a link?

    The other think I've just realised is that you are passing aoData as an initialisation parameter as well as aoColumns. aoData is an alias of aoColumns, and thus only one of them will "win". You need to combine the two into just aoColumns.

    Can I ask where you got the reference for aoData, as I need to remove that from the documentation if that is still in there!

    Allan
  • hanifnghanifng Posts: 3Questions: 0Answers: 0
    @allan

    thanks allan for your help :)

    fiuhh... I've tried various possibilities to solve this problem for more than 3 hours.
    I don't know whats wrong with 'sEcho', but if I remove it from the ajax response, it works for me.., and... thanks god now it's solved

    btw, I'm using my old php library and it still uses aoColumns and aoData separately, seems I have to rewrite them :D

    thanks again..
  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Is sEcho actually returning the sEcho parameter that is sent on every request, or is it just sending '1' back every time? It is basically a counter for DataTables to track requests, so if they arrive back out of sequence, then the old results won't be displayed.

    Allan
  • hanifnghanifng Posts: 3Questions: 0Answers: 0
    @allan

    ahh.., I've just realized that my sEcho is returning '1' on every request, my bad :D
    thanks though.
This discussion has been closed.