Results 1 to 4 of 4

Thread: [4.0.1] Bug displaying '<', '>' characters in ComboBox

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2008
    Location
    Poland
    Posts
    47

    Default [4.0.1] Bug displaying '<', '>' characters in ComboBox

    Hi,

    There is a bug in ComboBox when displaying html characters e.g. '<', '>'.
    I want to add '<Custom>' value to combo store. In combo picker empty string is displayed, but when I select this item, value is displayed correctly.
    When I put Ext.htmlEncode('<Custom>') value to combo store in combo picker string is displayed correctly but combo value is '&lt;Custom&gt;'

    combo.png

  2. #2
    Sencha User
    Join Date
    Feb 2008
    Location
    Poland
    Posts
    47

    Default

    Bug still occurs in [4.0.2]. Please fix it or give some workaround.

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Location
    Poland
    Posts
    47

    Default

    I found workaround to this issue. Hope can be helpful.

    Code:
    {
        xtype: 'combobox',     
        defaultListConfig: {
            getInnerTpl: function(displayField) {                    
                return '{' + displayField + ':htmlEncode}';    
            }
                                                    
        }   
    }

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2011
    Posts
    14

    Default What is the recommended way?

    What is the recommended way/place to handle html encoding/decoding? All my form fields are html encoded when they come down from the server as json objects. My combos behave the same as yours but also I have the same problem with my text fields. Is there a single place I can do Ext.String.htmlDecode() for all fields?

    Something like below works for text fields? But is this safe?
    PHP Code:
    Ext.define('mypatches.form.field.BasePatch', {  
      
    override'Ext.form.field.Base',
      
    valueToRaw: function (value) {    
        return 
    '' Ext.value(Ext.String.htmlDecode(value), '');  
       }
    }); 

Posting Permissions

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