If I understand correctly from your MochiKit post - you are trying to
put a python-dictionary as an argument to a javascript call.

To make this work you need to serialize the dict to its javascript
representation (or json, same thing). I have used jsonify to do this
with good success.

You need to make turbojson.jsonify.jsonify availabe to your templates
via the variable_providers:
http://docs.turbogears.org/1.0/stdvars

Then, in the template, you can serialize the dict to js like this:
edituser(${jsonify(user_info)}, ${rowid})

Arnar


On 2/22/07, Pearl <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am facing a weird problem. There are multiple users shown as rows in
> a table. When I am clicking on each row of a table, an edit box opens
> up in that row showing that particular user details.
>
> When clicking the edit button I am passing a dictionary which is of
> the form  {'username':'aby', 'password':'pass',
> 'address':'address','email':'[EMAIL PROTECTED]'......}
>
> All was working fine. Recently I began using turbogears1.0.1 and now
> the javascript for showing the edit box is not getting invoked.
>
> >From mochikit group I came to know this error has to do with Kid not
> being a Javascript serializer and that I need to use JSON. How can I
> serialize python dictionary to javascript understandable JSON format.
>
> It will be of great help if anyone can point out the cause of this
> error. (I would also like to know why it was working with turbogears
> 1.0.)
>
> Regards
> Roopesh
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to