PDA

View Full Version : Hyperlinks in grid



fshort
20 Sep 2007, 7:21 PM
Hi,
Is there a way to display hyperlinks in the grid without resorting to a renderer to encode the HTML? I have a service that is returning a JSON response with embedded <A> tags in the content. If I dont use a column renderer to encode the content, the hyperlink renders as raw text (i.e. <a href='blahblah'>hi</a>). I want to avoid using renderers since they are fairly expensive in a 50 row x 20 column grid where a good amount of cells have hyperlink content.

Is there a way to properly format the JSON response so any html content renders itself?

Thanks,
Fred

mystix
20 Sep 2007, 8:44 PM
just render it in json as a normal (i.e. unescaped) html string.
i.e. {myText : '<a href="http://www.extjs.com">ExtJS</a>'}

try it in the Inline Editing example in the Ext Documentation Centre.
just type this into any plant name field


<a href="http://www.extjs.com">ExtJS</a>

catacaustic
20 Sep 2007, 10:13 PM
I've seen this problem myself too. It's because whatever engine you're formatting the JSON string through is converting the "<" and ">" tags to their HTML equivalents so it'll be shown as a full HTML string, not as a formatted link. Just have to try and find out how you can get the server to send back the correct format for what you need there.

bhomass
18 Oct 2007, 1:21 PM
I am having this same problem but with XmlReader. The server is returning the < and > ok (without encoding), but GridPanel can not display them. I get a blank any time I embedded html tags in string type content.

what is the right way to do this?