Yazla
4 Jun 2010, 8:26 AM
Ext version tested:
Ext 3.2
Adapter used:
ext
css used:
only default ext-all.css
Browser versions tested against:
IE8
FF3 (firebug 1.3.0.10 installed)
Operating System:
Windows 7
Description:
Text with special symbols (&, " etc) not renders correctly i "displayfield", despite the fact that htmlEncode property is set to true.
Test Case:
var w = new Ext.Window({
width: 200
, items:[
{
xtype: 'displayfield'
, fieldLabel: 'Title'
, htmlEncode: true
, ref: 'titlefield'
, anchor: '100%'
}]
});
w.titlefield.setValue("foo&bar");
w.show();
See this URL : http://
Steps to reproduce the problem:
run code above.
The result that was expected:
label text should be "foo&bar"
The result that occurs instead:
label text is "foo&bar"
Possible fix:
[Ext.form.DisplayField.override({
setRawValue: function(v) {
var value = v;
if (this.htmlEncode) {
v = Ext.util.Format.htmlEncode(v);
}
return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = value);
}
});
Cheers.
Ext 3.2
Adapter used:
ext
css used:
only default ext-all.css
Browser versions tested against:
IE8
FF3 (firebug 1.3.0.10 installed)
Operating System:
Windows 7
Description:
Text with special symbols (&, " etc) not renders correctly i "displayfield", despite the fact that htmlEncode property is set to true.
Test Case:
var w = new Ext.Window({
width: 200
, items:[
{
xtype: 'displayfield'
, fieldLabel: 'Title'
, htmlEncode: true
, ref: 'titlefield'
, anchor: '100%'
}]
});
w.titlefield.setValue("foo&bar");
w.show();
See this URL : http://
Steps to reproduce the problem:
run code above.
The result that was expected:
label text should be "foo&bar"
The result that occurs instead:
label text is "foo&bar"
Possible fix:
[Ext.form.DisplayField.override({
setRawValue: function(v) {
var value = v;
if (this.htmlEncode) {
v = Ext.util.Format.htmlEncode(v);
}
return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = value);
}
});
Cheers.