htmldecode

Page 1 of 2 12 LastLast
  1. #1

    htmldecode

    i have a grid panel wherein if i put html tag in the content of a grid column, it gets displayed as is... meaning if i put in [B] tags then the column would be bold, even if use this code

     <ext:Column DataIndex="LastName" Header="Last Name" ColumnID="lastname">
             <Renderer Format="HtmlDecode" />
    </ext:Column>
  2. #2

    RE: htmldecode

    Shouldnt you encode the string to get the tags displayed as tags instead of interpreted as html?

    rgds
  3. #3

    RE: htmldecode

    yeah but why is it that even if i set the autoEncode property of the grid panel to true it still renders as html?
  4. #4

    RE: htmldecode

    Hi,

    I believe that you should use HtmlEncode instead HtmlDecode
  5. #5

    RE: htmldecode

    is htmlencode even available in v.82?

    error:
    Cannot
    create an object of type 'Coolite.Ext.Web.RendererFormat' from its
    string representation 'HtmlEncode' for the 'Format' property.
  6. #6

    RE: htmldecode

    Hi,

    Yes, it seems 0.8.2 doesn't contain that value (but 1.0 contains)
    Use the following renderer
    <Renderer Handler="return Ext.util.Format.htmlEncode(value);"/>
  7. #7

    RE: htmldecode

    ok thanks
  8. #8

    RE: htmldecode

    is there any better way to do this other than setting each renderer for each grid column that i have?
  9. #9

    RE: htmldecode

    seems like i really have to put something like this on each grid column since even if i encode the text before saving to db, it still renders as html without the encoding before display... even if its store as "&amp;lt;b&amp;gt;Jucom&amp;lt;/b&amp;gt;" in the database it still renders as bold text in the grid column
  10. #10

    RE: htmldecode

    hayyyy why is it like this? if i save an encoded string in db, i cannot decode it anymore or show in in plain tags? if i save text encoded in DB = saved text in db is &amp;lt;b&amp;gt;text&amp;lt;/b&amp;gt;

    using <Renderer Handler="return Ext.util.Format.htmlEncode(value);"/> will result in blank grid column

    using <Renderer Handler="return Ext.util.Format.htmlDecode(value);"/> will result in blank grid column


    using <Renderer Format="htmlDecode"/> will result in bold text


    using no renderer will result in bold text
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Problem with HtmlEncode / HtmlDecode
    By eaglemobile in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 18, 2011, 2:42 PM

Posting Permissions