I'm using jquery 1.4.2 and using
@expose('json')
works for me.
here is what I include in my html template :
-----------
<head py:match="head" py:attrs="select('@*')">
<meta content="text/html; charset=UTF-8" http-equiv="content-type"
py:replace="''"/>
<title py:replace="''">Your title goes here</title>
<link rel="stylesheet" type="text/css" media="screen"
href="${tg.url('/css/style.css')}" />
<link rel="stylesheet" type="text/css" media="screen"
href="/css/redmond/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen"
href="/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen"
href="/css/jquery.searchFilter.css" />
<link rel="stylesheet" href="/css/jquery.jdMenu.css" type="text/css" />
<style>
.ui-datepicker {z-index: 9000; /* added */ width: 17em; padding: .2em
.2em 0; }
</style>
<script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="/js/jquery-ui-1.7.2.custom.min.js"
type="text/javascript"></script>
<script type="text/javascript" src="/js/jquery.dimensions.js"></script>
<script type="text/javascript" src="/js/jquery.positionBy.js"></script>
<script type="text/javascript" src="/js/jquery.bgiframe.js"></script>
<script type="text/javascript" src="/js/jquery.jdMenu.js"></script>
<script src="/js/i18n/grid.locale-tr.js"
type="text/javascript"></script>
<script src="/js/i18n/ui.datepicker-tr.js"
type="text/javascript"></script>
<script type="text/javascript">
$.jgrid.no_legacy_api = true;
$.jgrid.useJSON = true;
</script>
<script src="/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<meta py:replace="select('*')"/>
<link rel="stylesheet" type="text/css" media="screen"
href="${tg.url('/css/style.css')}" />
<link rel="stylesheet" type="text/css" media="screen"
href="${tg.url('/css/admin.css')}" />
</head>
-----------
and this is the end of a controller function (build json data and return
the data)
-----------
rows = [{'cell':[
permission.permission_id,
group_id,
permission.permission_name,
permission.description,
], 'id':str(permission.permission_id)} for
permission in permissions]
return dict(page=page, total=pages_total,
records=records_count, rows=rows)
-----------
Ed Valentine yazmış:
where did you find the information / demo for simplejson dump? I have
been using @expose("json"), It was working with the jqgrid until
3.6.
Thanks for the quick reply.
On Jun 16, 2:46 pm, "Diez B. Roggisch" <[email protected]> wrote:
Am 16.06.2010 um 21:38 schrieb Ed Valentine:
I have been using TG2 and jqgrid for some time and all was working
fine. Jqgrid has been upgraded. With this switch we directly use the
jQuery parsing of JSON data. As of version 1.4.x of jQuery this
parsing is strict.
Example is the keyword:value pair must be double quoted.
How do I set the json to conform to this new standard? Are there
parameters in the json or simplejson lib code to change the output?
Any suggestions will be appreciated.
Why do you think you need to do anything? Do you actually experience
any problems? For me, it works out of the box:
>>> from simplejson import *
>>> dumps({"foo" : "bar"})
'{"foo": "bar"}'
Diez
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.