3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
8 * @class Ext.form.DisplayField
9 * @extends Ext.form.Field
10 * A display-only text field which is not validated and not submitted.
12 * Creates a new DisplayField.
13 * @param {Object} config Configuration options
16 Ext.form.DisplayField = Ext.extend(Ext.form.Field, {
17 validationEvent : false,
18 validateOnBlur : false,
19 defaultAutoCreate : {tag: "div"},
21 * @cfg {String} fieldClass The default CSS class for the field (defaults to <tt>"x-form-display-field"</tt>)
23 fieldClass : "x-form-display-field",
25 * @cfg {Boolean} htmlEncode <tt>false</tt> to skip HTML-encoding the text when rendering it (defaults to
26 * <tt>false</tt>). This might be useful if you want to include tags in the field's innerHTML rather than
27 * rendering them as string literals per the default logic.
32 initEvents : Ext.emptyFn,
38 validate : function(){
42 getRawValue : function(){
43 var v = this.rendered ? this.el.dom.innerHTML : Ext.value(this.value, '');
44 if(v === this.emptyText){
48 v = Ext.util.Format.htmlDecode(v);
53 getValue : function(){
54 return this.getRawValue();
61 setRawValue : function(v){
63 v = Ext.util.Format.htmlEncode(v);
65 return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = v);
68 setValue : function(v){
73 * @cfg {String} inputType
77 * @cfg {Boolean} disabled
81 * @cfg {Boolean} readOnly
85 * @cfg {Boolean} validateOnBlur
89 * @cfg {Number} validationDelay
93 * @cfg {String/Boolean} validationEvent
98 Ext.reg('displayfield', Ext.form.DisplayField);