4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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'>/**
19 </span> * A display-only text field which is not validated and not submitted. This is useful for when you want to display a
20 * value from a form's {@link Ext.form.Basic#load loaded data} but do not want to allow the user to edit or submit that
21 * value. The value can be optionally {@link #htmlEncode HTML encoded} if it contains HTML markup that you do not want
24 * If you have more complex content, or need to include components within the displayed content, also consider using a
25 * {@link Ext.form.FieldContainer} instead.
30 * Ext.create('Ext.form.Panel', {
31 * renderTo: Ext.getBody(),
35 * title: 'Final Score',
37 * xtype: 'displayfield',
42 * xtype: 'displayfield',
43 * fieldLabel: 'Visitor',
44 * name: 'visitor_score',
52 Ext.define('Ext.form.field.Display', {
53 extend:'Ext.form.field.Base',
54 alias: 'widget.displayfield',
55 requires: ['Ext.util.Format', 'Ext.XTemplate'],
56 alternateClassName: ['Ext.form.DisplayField', 'Ext.form.Display'],
58 '<div id="{id}" class="{fieldCls}"></div>',
65 <span id='Ext-form-field-Display-cfg-fieldCls'> /**
66 </span> * @cfg {String} [fieldCls="x-form-display-field"]
67 * The default CSS class for the field.
69 fieldCls: Ext.baseCSSPrefix + 'form-display-field',
71 <span id='Ext-form-field-Display-cfg-htmlEncode'> /**
72 </span> * @cfg {Boolean} htmlEncode
73 * false to skip HTML-encoding the text when rendering it. This might be useful if you want to
74 * include tags in the field's innerHTML rather than rendering them as string literals per the default logic.
78 validateOnChange: false,
80 initEvents: Ext.emptyFn,
88 validate: function() {
92 getRawValue: function() {
96 setRawValue: function(value) {
98 value = Ext.value(value, '');
101 me.inputEl.dom.innerHTML = me.htmlEncode ? Ext.util.Format.htmlEncode(value) : value;
107 getContentTarget: function() {
111 <span id='Ext-form-field-Display-cfg-inputType'> /**
112 </span> * @cfg {String} inputType
115 <span id='Ext-form-field-Display-cfg-disabled'> /**
116 </span> * @cfg {Boolean} disabled
119 <span id='Ext-form-field-Display-cfg-readOnly'> /**
120 </span> * @cfg {Boolean} readOnly
123 <span id='Ext-form-field-Display-cfg-validateOnChange'> /**
124 </span> * @cfg {Boolean} validateOnChange
127 <span id='Ext-form-field-Display-cfg-checkChangeEvents'> /**
128 </span> * @cfg {Number} checkChangeEvents
131 <span id='Ext-form-field-Display-cfg-checkChangeBuffer'> /**
132 </span> * @cfg {Number} checkChangeBuffer