2

I have already develop ExtJS application that application has more than 200 grids. Some of grid have <> like HTML. My grid can't view HTML So i change Server side function(common get function) as htmlspecialchars($value, ENT_QUOTES);

After that grid can view HTML value like

problem is when rowediting mode view value as encode value(&lt;start)

note: this happen every form, grid-rowediting,

i try to override every input filed as answer but that is not work for me

launch: function() {
    panel = Ext.create('me_project.view.me_panel', {renderTo: 'form'});
    Ext.override(Ext.form.field.Base, {
        setValue: function(val) {
            val = Ext.util.Format.htmlDecode(val);
            return this.callParent([val]);
        }
    });
}
Community
  • 1
  • 1
user881703
  • 1,111
  • 3
  • 19
  • 38

1 Answers1

1

The htmlDecode function only decodes the < > & ' symbols as shown in documentation http://dev.sencha.com/deploy/ext-1.1.1/docs/output/Ext.util.Format.html. You can try setting the autoEncode: true property as shown in http://all-docs.info/extjs4/docs/api/Ext.grid.Editing.html. To decode something that is html encoded with jquery you can use val = $('<\div>').html(val).text(); With javascript you can use var textArea = document.createElement("textarea"); textArea.innerHTML =val; val = textArea.value;

Moishe Lipsker
  • 2,974
  • 2
  • 21
  • 29