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