Results 1 to 5 of 5

Thread: GridPanel - How to show HTML tags?

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    31

    Default GridPanel - How to show HTML tags?

    Hello,

    in my GridPanel with remote store from mysql db, I have to show a field with HTML tags.

    Now my grid display this value with HTML tags, you can see an example here:
    ticket.JPG

    How can I render the HTML tag in the column?
    These HTML tags are written directly in the db by a rich text editor (tinyMCE).


    Thank you.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Use a renderer which encodes the HTML

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    31

    Default

    Can you show me an example of a renderer function for encode HTML?

    Thank you.

  4. #4

  5. #5
    Sencha User
    Join Date
    Sep 2010
    Posts
    31

    Default

    Hello,

    I've done this... and works good!

    Code:
    var grid = new Ext.grid.GridPanel({
    store: store,
    columns: [ 
    	{id:'termine', header: "Termine", width: 400, sortable: true, dataIndex: 'termine', filter:{ }},
    	{id:'argomento', header: "Argomento", width: 400, sortable: true, renderer: arg, dataIndex: 'argomento', filter:{ }}  
    ],               
    bbar: new Ext.PagingToolbar({
    	pageSize: 15,
    	store: store,
    	displayInfo: true,
    	plugins: [new Ext.ux.ProgressBarPager()]
    }),    
    plugins: [filterRow],
    
    tbar: tbar,       
    height:660,
    width:1010,
    frame:true,                
    title:
    '<div align="center"><img src="images/bannermicologia.png" alt="" border="0"></div>',
    renderTo: "grid-example"
    });
    
    function arg(val){
    	return Ext.util.Format.htmlDecode(val);
    }
    Thank you!

Similar Threads

  1. HTML tags in my panel are getting ignored
    By ferr0084 in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 31 Mar 2010, 12:27 PM
  2. HTML-Tags in value of TextArea
    By TomToms in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 29 Aug 2009, 5:01 PM
  3. textField and html tags
    By kohyea in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 28 Oct 2008, 7:10 AM
  4. Escaping html tags
    By okwei in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 4 Sep 2008, 11:06 AM
  5. removing html tags
    By nolsie in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 30 Oct 2007, 7:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •