Upgrading 1.6 to 1.7.4 troubles
Upgrading 1.6 to 1.7.4 troubles
Hi, I'm trying to upgrade from 1.6 to 1.7.4 and I have the problem here:
[code]
oTable = $('#example').dataTable( {
"bServerSide":false,
"sAjaxSource": '/tableFromJson/'+typeName+'FullList.txt'
[/code]
In 1.6 this code load table from cherrypy server. But in 1.7.4 request to server didn't sended.
DataTables is no more compatible with cherrypy?
Is there any way to pass the table as a string?
[code]
oTable = $('#example').dataTable( {
"bServerSide":false,
"sAjaxSource": '/tableFromJson/'+typeName+'FullList.txt'
[/code]
In 1.6 this code load table from cherrypy server. But in 1.7.4 request to server didn't sended.
DataTables is no more compatible with cherrypy?
Is there any way to pass the table as a string?
This discussion has been closed.
Replies
Allan
It looks like the query isn't initiated on client side.
Here is the snippet of the code on the server side. I don't get the print "tableFromJson" in my terminal.
[code]
@cherrypy.expose
def tableFromJson(self, fileName="FullList.txt"):
print "tableFromJson"
return FileIO.FileIO().makeJson(fileName)
[/code]
In the former version (1.6) I've checked JSON sent back is valid following your validator
Allan
GET http://localhost:8080/tableFromJson/TrackingFullList.txt?_=1290155332333 405 Not Found
With error: 'Unexpected query string parameters: _'
Params: _ 1290155332333
The same (working) output for 16:
http://localhost:8080/tableFromJson/TrackingFullList.txt 200 Ok
I think that the problems comes from a parameter.
The path '/TrackingFullListTable.txt' was not found.
The file is present and readable by everyone:
$ ls -l TrackingFullListTable.txt
-rw-r--r-- Nov 18 14:43 TrackingFullListTable.txt
Interesting! The web-server is objecting to the anti IE cache var that jQuery is putting on the XHR. I've not come across that before. What you can do is use fnServerData to construct an Ajax request (like this - http://datatables.net/examples/server_side/custom_vars.html - this is for server-side processing, but works for a normal sAjaxSource as well) to construct your own $.ajax request without the anti-IE cache.
Out of interest, what web-server are you using?
Allan
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
}
[/code]
Now it works)
Thanks for the help.
As server I use Cherrypy, a python library: http://www.cherrypy.org/