3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * A display-only text field which is not validated and not submitted. This is useful for when you want to display a
17 * 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
18 * value. The value can be optionally {@link #htmlEncode HTML encoded} if it contains HTML markup that you do not want
21 * If you have more complex content, or need to include components within the displayed content, also consider using a
22 * {@link Ext.form.FieldContainer} instead.
27 * Ext.create('Ext.form.Panel', {
28 * renderTo: Ext.getBody(),
32 * title: 'Final Score',
34 * xtype: 'displayfield',
39 * xtype: 'displayfield',
40 * fieldLabel: 'Visitor',
41 * name: 'visitor_score',
49 Ext.define('Ext.form.field.Display', {
50 extend:'Ext.form.field.Base',
51 alias: 'widget.displayfield',
52 requires: ['Ext.util.Format', 'Ext.XTemplate'],
53 alternateClassName: ['Ext.form.DisplayField', 'Ext.form.Display'],
55 '<div id="{id}" class="{fieldCls}"></div>',
63 * @cfg {String} [fieldCls="x-form-display-field"]
64 * The default CSS class for the field.
66 fieldCls: Ext.baseCSSPrefix + 'form-display-field',
69 * @cfg {Boolean} htmlEncode
70 * false to skip HTML-encoding the text when rendering it. This might be useful if you want to
71 * include tags in the field's innerHTML rather than rendering them as string literals per the default logic.
75 validateOnChange: false,
77 initEvents: Ext.emptyFn,
85 validate: function() {
89 getRawValue: function() {
93 setRawValue: function(value) {
95 value = Ext.value(value, '');
98 me.inputEl.dom.innerHTML = me.htmlEncode ? Ext.util.Format.htmlEncode(value) : value;
104 getContentTarget: function() {
109 * @cfg {String} inputType
113 * @cfg {Boolean} disabled
117 * @cfg {Boolean} readOnly
121 * @cfg {Boolean} validateOnChange
125 * @cfg {Number} checkChangeEvents
129 * @cfg {Number} checkChangeBuffer