3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.form.DisplayField"></div>/**
\r
10 * @class Ext.form.DisplayField
\r
11 * @extends Ext.form.Field
\r
12 * A display-only text field which is not validated and not submitted.
\r
14 * Creates a new DisplayField.
\r
15 * @param {Object} config Configuration options
\r
16 * @xtype displayfield
\r
18 Ext.form.DisplayField = Ext.extend(Ext.form.Field, {
\r
19 validationEvent : false,
\r
20 validateOnBlur : false,
\r
21 defaultAutoCreate : {tag: "div"},
\r
22 <div id="cfg-Ext.form.DisplayField-fieldClass"></div>/**
\r
23 * @cfg {String} fieldClass The default CSS class for the field (defaults to <tt>"x-form-display-field"</tt>)
\r
25 fieldClass : "x-form-display-field",
\r
26 <div id="cfg-Ext.form.DisplayField-htmlEncode"></div>/**
\r
27 * @cfg {Boolean} htmlEncode <tt>false</tt> to skip HTML-encoding the text when rendering it (defaults to
\r
28 * <tt>false</tt>). This might be useful if you want to include tags in the field's innerHTML rather than
\r
29 * rendering them as string literals per the default logic.
\r
34 initEvents : Ext.emptyFn,
\r
36 isValid : function(){
\r
40 validate : function(){
\r
44 getRawValue : function(){
\r
45 var v = this.rendered ? this.el.dom.innerHTML : Ext.value(this.value, '');
\r
46 if(v === this.emptyText){
\r
49 if(this.htmlEncode){
\r
50 v = Ext.util.Format.htmlDecode(v);
\r
55 getValue : function(){
\r
56 return this.getRawValue();
\r
59 getName: function() {
\r
63 setRawValue : function(v){
\r
64 if(this.htmlEncode){
\r
65 v = Ext.util.Format.htmlEncode(v);
\r
67 return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = v);
\r
70 setValue : function(v){
\r
71 this.setRawValue(v);
\r
74 <div id="cfg-Ext.form.DisplayField-inputType"></div>/**
\r
75 * @cfg {String} inputType
\r
78 <div id="cfg-Ext.form.DisplayField-disabled"></div>/**
\r
79 * @cfg {Boolean} disabled
\r
82 <div id="cfg-Ext.form.DisplayField-readOnly"></div>/**
\r
83 * @cfg {Boolean} readOnly
\r
86 <div id="cfg-Ext.form.DisplayField-validateOnBlur"></div>/**
\r
87 * @cfg {Boolean} validateOnBlur
\r
90 <div id="cfg-Ext.form.DisplayField-validationDelay"></div>/**
\r
91 * @cfg {Number} validationDelay
\r
94 <div id="cfg-Ext.form.DisplayField-validationEvent"></div>/**
\r
95 * @cfg {String/Boolean} validationEvent
\r
100 Ext.reg('displayfield', Ext.form.DisplayField);
\r