2015-04-01 70 views
1

我在ExtJS的應用程序,comob盒ID(valueField)HTML編碼(因爲有特殊字符)連擊使用常用方法覆蓋每個Combo getValue字段?

我怎麼可以覆蓋每一個組合getValue方法返回解碼HTML值

注:我重寫文本的場使用波紋管方法

Ext.override(Ext.form.field.Base, { 
    transformRawValue: function(val) { 
     val = Ext.util.Format.htmlDecode(val); 
     return this.callParent([val]); 
    } 
}); 

回答

1

在4.x的SETVALUE +,覆蓋具有不同的語法。

Ext.define("App.overrides.form.ComboBox",{ 
    override: 'Ext.form.ComboBox', 
    getValue: function() { 
     return Ext.util.Format.htmlDecode(this.value); 
    } 
});