1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-form.field.Display-method-constructor'><span id='Ext-form.field.Display'>/**
2 </span></span> * @class Ext.form.field.Display
3 * @extends Ext.form.field.Base
4 * <p>A display-only text field which is not validated and not submitted. This is useful for when you want
5 * to display a value from a form's {@link Ext.form.Basic#load loaded data} but do not want to allow the
6 * user to edit or submit that value. The value can be optionally {@link #htmlEncode HTML encoded} if it contains
7 * HTML markup that you do not want to be rendered.</p>
8 * <p>If you have more complex content, or need to include components within the displayed content, also
9 * consider using a {@link Ext.form.FieldContainer} instead.</p>
10 * {@img Ext.form.Display/Ext.form.Display.png Ext.form.Display component}
11 * <p>Example:</p>
12 * <pre><code>
13 Ext.create('Ext.form.Panel', {
19 xtype: 'displayfield',
24 xtype: 'displayfield',
25 fieldLabel: 'Visitor',
26 name: 'visitor_score',
32 renderTo: Ext.getBody()
34 </code></pre>
37 * Creates a new DisplayField.
38 * @param {Object} config Configuration options
42 Ext.define('Ext.form.field.Display', {
43 extend:'Ext.form.field.Base',
44 alias: 'widget.displayfield',
45 requires: ['Ext.util.Format', 'Ext.XTemplate'],
46 alternateClassName: ['Ext.form.DisplayField', 'Ext.form.Display'],
48 '<div id="{id}" class="{fieldCls}"></div>',
55 <span id='Ext-form.field.Display-cfg-fieldCls'> /**
56 </span> * @cfg {String} fieldCls The default CSS class for the field (defaults to <tt>"x-form-display-field"</tt>)
58 fieldCls: Ext.baseCSSPrefix + 'form-display-field',
60 <span id='Ext-form.field.Display-cfg-htmlEncode'> /**
61 </span> * @cfg {Boolean} htmlEncode <tt>false</tt> to skip HTML-encoding the text when rendering it (defaults to
62 * <tt>false</tt>). This might be useful if you want to include tags in the field's innerHTML rather than
63 * rendering them as string literals per the default logic.
67 validateOnChange: false,
69 initEvents: Ext.emptyFn,
77 validate: function() {
81 getRawValue: function() {
85 setRawValue: function(value) {
87 value = Ext.value(value, '');
90 me.inputEl.dom.innerHTML = me.htmlEncode ? Ext.util.Format.htmlEncode(value) : value;
96 getContentTarget: function() {
100 <span id='Ext-form.field.Display-cfg-inputType'> /**
101 </span> * @cfg {String} inputType
104 <span id='Ext-form.field.Display-cfg-disabled'> /**
105 </span> * @cfg {Boolean} disabled
108 <span id='Ext-form.field.Display-cfg-readOnly'> /**
109 </span> * @cfg {Boolean} readOnly
112 <span id='Ext-form.field.Display-cfg-validateOnChange'> /**
113 </span> * @cfg {Boolean} validateOnChange
116 <span id='Ext-form.field.Display-cfg-checkChangeEvents'> /**
117 </span> * @cfg {Number} checkChangeEvents
120 <span id='Ext-form.field.Display-cfg-checkChangeBuffer'> /**
121 </span> * @cfg {Number} checkChangeBuffer
125 </pre></pre></body></html>