4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-form-field-Display-method-constructor'><span id='Ext-form-field-Display'>/**
19 </span></span> * @class Ext.form.field.Display
20 * @extends Ext.form.field.Base
21 * <p>A display-only text field which is not validated and not submitted. This is useful for when you want
22 * to display a value from a form's {@link Ext.form.Basic#load loaded data} but do not want to allow the
23 * user to edit or submit that value. The value can be optionally {@link #htmlEncode HTML encoded} if it contains
24 * HTML markup that you do not want to be rendered.</p>
25 * <p>If you have more complex content, or need to include components within the displayed content, also
26 * consider using a {@link Ext.form.FieldContainer} instead.</p>
27 * {@img Ext.form.Display/Ext.form.Display.png Ext.form.Display component}
28 * <p>Example:</p>
29 * <pre><code>
30 Ext.create('Ext.form.Panel', {
36 xtype: 'displayfield',
41 xtype: 'displayfield',
42 fieldLabel: 'Visitor',
43 name: 'visitor_score',
49 renderTo: Ext.getBody()
51 </code></pre>
54 * Creates a new DisplayField.
55 * @param {Object} config Configuration options
59 Ext.define('Ext.form.field.Display', {
60 extend:'Ext.form.field.Base',
61 alias: 'widget.displayfield',
62 requires: ['Ext.util.Format', 'Ext.XTemplate'],
63 alternateClassName: ['Ext.form.DisplayField', 'Ext.form.Display'],
65 '<div id="{id}" class="{fieldCls}"></div>',
72 <span id='Ext-form-field-Display-cfg-fieldCls'> /**
73 </span> * @cfg {String} fieldCls The default CSS class for the field (defaults to <tt>"x-form-display-field"</tt>)
75 fieldCls: Ext.baseCSSPrefix + 'form-display-field',
77 <span id='Ext-form-field-Display-cfg-htmlEncode'> /**
78 </span> * @cfg {Boolean} htmlEncode <tt>false</tt> to skip HTML-encoding the text when rendering it (defaults to
79 * <tt>false</tt>). This might be useful if you want to include tags in the field's innerHTML rather than
80 * rendering them as string literals per the default logic.
84 validateOnChange: false,
86 initEvents: Ext.emptyFn,
94 validate: function() {
98 getRawValue: function() {
102 setRawValue: function(value) {
104 value = Ext.value(value, '');
107 me.inputEl.dom.innerHTML = me.htmlEncode ? Ext.util.Format.htmlEncode(value) : value;
113 getContentTarget: function() {
117 <span id='Ext-form-field-Display-cfg-inputType'> /**
118 </span> * @cfg {String} inputType
121 <span id='Ext-form-field-Display-cfg-disabled'> /**
122 </span> * @cfg {Boolean} disabled
125 <span id='Ext-form-field-Display-cfg-readOnly'> /**
126 </span> * @cfg {Boolean} readOnly
129 <span id='Ext-form-field-Display-cfg-validateOnChange'> /**
130 </span> * @cfg {Boolean} validateOnChange
133 <span id='Ext-form-field-Display-cfg-checkChangeEvents'> /**
134 </span> * @cfg {Number} checkChangeEvents
137 <span id='Ext-form-field-Display-cfg-checkChangeBuffer'> /**
138 </span> * @cfg {Number} checkChangeBuffer