AjaxGrid and html

2 views
Skip to first unread message

mulicheng

unread,
May 19, 2006, 4:15:09 PM5/19/06
to TurboGears
I'd like to stick a little bit of html in one of the AjaxGrid's cells.
I can send html back from the server but the values get escaped before
they make it to the cells. Is there a way to turn that off or do I
have to create my own render function for the Widgets.grid?

Thanks
Dennis

mulicheng

unread,
May 19, 2006, 5:15:22 PM5/19/06
to TurboGears
As a workaround, I returned my own response from my search controller
instead of using format='json' and returning a dict.

example:

@expose()
def search(self,**kw):
cherrypy.response.headers['Content-Type'] = 'text/javascript'
return "{ rows: [[ IMG( { src: '...' } ), 'other text data'], [ etc...
]] }"

It's ugly but it works for now.
Any suggestions on how to accomplish a similar thing without hacking
the response?

Reply all
Reply to author
Forward
0 new messages