Home › Forums › Guriddo jqGrid JS › Help › no data display with JQGrid and Turbogears
I really like the possibilities of the widget as well as the documentation and support. We are using the Turbogears Python framework and I have found a developer using this combination.
I have the grid displayed in Firefox with firebug running.
I have been trying this and am close but the data does not display in the grid.
HTML:
Hello,
I think you have a bad definition in jsonReader, which acts to this error. For this type of json response try this:
Thanks. That stopped the error.
I still do not have the data displaying in the grid. It is not in the response. All I see is the
If I clink the sort arrows on the 'ID' column, I get a request to server and response in the Turbogears log and the message “Loading..” flashes, but no visable data.
Does this sound like something missing between the Trubogears controller and the templete / page generation?
Thanks for the help.
From what I can tell, this could be the controller not sending the data in the correct JSON response format. Do you have control over that?
My suggestion is using a tool like Fiddler or FireBug to see what really gets sent back to the client (View Source in Browser will not work sinice the grid uses client-side rendering based on JSON)
Another thing to try – you can hook the loadError event of the grid and see if it gets fired and with what data.
Regards,
Rumen Stankov
this is the log of the dist sent from the controller :
23:06:59,946 DEBUG [sensadata.controllers.root]
{'records': '5', 'total': '1',
'rows': [{'cell': ['10009901', '0', '”11024438″', 'None'], 'id': '279976'},
{'cell': ['10009901', '0', '”11014912″', 'None'], 'id': '279977'},
{'cell': ['10009901', '4423', '”11024421″', 'None'], 'id': '279978'},
{'cell': ['10009901', '4425', '”11014910″', 'None'], 'id': '279979'},
Hello,
I think yes. In this case you should escape it by example:
23:06:59,946 DEBUG [sensadata.controllers.root]
{'records': '5', 'total': '1',
'rows': [{'cell': ['10009901', '0', '\”11024438\”', 'None'], 'id': '279976'},
…
Regards
Tony
Hope this does not sound really dumb.
All of the response viewers are showing the full page without
being replaced with data.
Is the page supposed to load and then send the data request and load the data? I am thinking that Turbogears as I have it know is passing the page and the json data to the stack in TG2 and TG2 expects to do the replacement in the page.
If jqgrid is to do the replacement of
Hello,
No jqGrid does not replace the table. It just add some additinal elements below and above it, but table stay the same. If you have FireBug you can easy see the the table is still here, and after that we populate the table with data.
I do not known what TurboGear do, so I can not
I must be doing something dumb. This is the exact return sent to the client after the form is displayed with no data.I thought this to be the correct format for the response and the Javascript is to read this and insert into the grid.
Any suggestions?
Does the content-type need to be “json”?
HTTP/1.0 200 OK
Server: PasteWSGIServer/0.5 Python/2.5.4
Date: Mon, 16 Nov 2009 03:18:45 GMT
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8
Content-Length: 260
{page:”1″,total:”1″,records:”5″, rows:[{“279976″,”10009901″,”0″,”None”,”None”},{“279977″,”10009901″,”0″,”11014912″,”None”},{“279978″,”10009901″,”4423″,”11024421″,”None”},{“279979″,”10009901″,”4425″,”11014910″,”None”},{“279975″,”12194001″,”0″,”11083108″,”1”},]}
Hello,
Any error in the console.
Also in this case you should set cell to empty string in jsonReader: See here:
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data
jsonReader : {
Is there a way to get the jqgrid.js code with the line feed/ carage returns? now I am getting the error 'invalid object initualizer' and I can not determine where in the code.
If I set the datatype = 'jsonstring' in the html, there is no request sent back to the host.
I got the table to show by using 'GET' instead of post, but am
As far as I can tell, the controller, html, and scripts from your first post looks about the same as my application.
Just discovered css is working in ie, but getting message:
[Exception… “Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIChannel.contentType]” nsresult: “0x80040111 (NS_ERROR_NOT_AVAILABLE)” location: “JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/FeedProcessor.js :: FP_onStartRequest :: line 1440″ data: no] from firefox
jquery-1.3.2
firefox 3.5.5
This may not be correct thread.
I am glad someone has been able to get this to work. I have upgraded to grid3.6, gone to the Lightness UI, and switched to the /src .js code.
The response is:
HTTP/1.0 200 OK
Server: PasteWSGIServer/0.5 Python/2.5.4
Date: Mon, 16 Nov 2009 03:18:45 GMT
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8
Content-Length: 260
{page:”1″,total:”1″,records:”5″, rows:[{“279976″,”10009901″,”0″,”None”,”None”}{“279977″,”10009901″,”0″,”11014912″,”None”},{“279978″,”10009901″,”4423″,”11024421″,”None”},{“279979″,”10009901″,”4425″,”11014910″,”None”},{“279975″,”12194001″,”0″,”11083108″,”1”},]}
With NO cr/lf in the data, one long string.
I am getting an error “invalid object initializer”
notnow said:
As far as I can tell, the controller, html, and scripts from your first post looks about the same as my application.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top