Results 1 to 2 of 2

Thread: How To Manage TAG HTML in a renderer of an EditorGrid?

  1. #1
    Sencha User axelaxel's Avatar
    Join Date
    Sep 2008
    Location
    Italy
    Posts
    86
    Vote Rating
    0
      0  

    Default How To Manage TAG HTML in a renderer of an EditorGrid?

    hi guys,
    i've an EditorGrid and my problem is the following:

    i've a column which editor is a combobox, and the values received by the combobox are id numbers => in the renderer i've the parser to set an image, depending by the value.

    the problem i've is that while i open the combobox, to chose another value, the cell of the grid where initally there was the image selected, shows the html code of the image.
    i attach a photo of the mistake, to make it clearer.

    any ideas how to solve it?
    i search on the forum, but i couldn't find any solutions
    thank you


    axel


    errore griglia.jpg



    Code:
               var cmRenderStatus = function cmRenderSiNo(v, params, record, rowIndex, columnIndex, store) {
                    switch(v){
                        case 0:
                        case 1:
                        case 2:
                        case '0':
                        case '1':
                        case '2':
                            sImageName = v;
                            break;
                            
                        default:
                            sImageName = 'X';
                            break;                                                                                                                       
                    }                                                                                                                                    
                    
                    return '<img src="/project/bostik/html/css/icons/' + sImageName + '.png">';
                };
                var cmEditorStatus = function () {
                    return new Ext.form.ComboBox({
                        mode: 'local',
                        editable: false,
                        typeAhead: true,
                        triggerAction: 'all',
                        displayField: 'value',
                        valueField: 'id',
                        validateOnBlur: false,
                        listWidth: 40,
                        store: new Ext.data.SimpleStore({
                            fields: ['id', 'value'],
                            data: [
                                ['0',    '<img src="/project/bostik/html/css/icons/0.png">'],
                                ['1',    '<img src="/project/bostik/html/css/icons/1.png">'],
                                ['2',    '<img src="/project/bostik/html/css/icons/2.png">']
                            ]
                        })
                    });
                };
    Last edited by axelaxel; 8 Jul 2010 at 11:40 PM. Reason: clearer description

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    86
      0  

    Default

    The combo box doesn't work this way. YOu can't inject raw HTML into an input field.

Similar Threads

  1. html editor and <img> </img> tag ?
    By franklt69 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 1 Feb 2010, 9:05 AM
  2. Using grid column renderer with editor
    By harperml in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 22 Dec 2008, 1:51 PM
  3. Is there ext tag like html tag?
    By xiaops2005 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 29 Aug 2008, 1:15 AM
  4. [ext 2.0] combo - renderer - grid - editor
    By genius551v in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 23 Feb 2008, 7:53 AM
  5. [ext 2.0] combo - renderer - grid - editor
    By genius551v in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 13 Feb 2008, 8:49 PM

Posting Permissions

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