[EMAIL PROTECTED] ha scritto:
> Hi,
> I'm trying to implement a demo "http://extjs.com/deploy/ext/
> examples/grid/paging.html" of extjs Lib with turbogears.
>
> This page uses a ScriptProxy object to send a request and handle
> the response.It expectes a special format of responseText which looks
> like "callback001( {"key":"value"} )".
>
> In turbogear, we can use @expose("json") to return a JSON
> object.But how can I insert "callback001(" to the head and append ")"
> at the tail?
>
> thanks for you reply.
>
>
the turbojson lib do this.
the expose("json") declration can handle only "dict like" result.
>>> from turbojson.jsonify import encode
>>> encode('callback001( {"key":"value"} )')
'"callback001( {\\"key\\":\\"value\\"} )"'
Glauco
--
+------------------------------------------------------------+
Glauco Uri - Programmatore
glauco(at)allevatori.com
Sfera Carta Software(R) [EMAIL PROTECTED]
Via Bazzanese,69 Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---