PDA

View Full Version : Problem with < character in grid



kaps77
1 Nov 2007, 9:40 PM
Hi,
I have to display some text containing < character in the grid (header as well as the cell). The grid can have header text like
a<abba>b
However in this case the string is truncated from the begining of the < character.
On inspecting with Firebug i get the following HTML from that particular cell:


<div class="x-grid-hd-inner x-grid-hd-8" title="">
<div unselectable="on" class="x-grid-hd-text">a<abba _moz-userdefined="">b
<img src="/WebEditor/thirdParty/extjs/images/default/s.gif" class="x-grid-sort-icon"/>
</abba>
</div></div>

Is this a known issue, and if yes what is the workaround, if any.
regards,
Kapil

fay
2 Nov 2007, 2:47 AM
You need to use ASCII character codes (http://www.web-source.net/symbols.htm) for certain symbols, so you can either insert them directly:


a&lt;abba&gt;b

or use htmlEncode (http://extjs.com/deploy/ext/docs/output/Ext.util.Format.html#htmlEncode):


Ext.util.Format.htmlEncode('a<abba>b')