3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
15 <div id="cls-Ext.form.DisplayField"></div>/**
16 * @class Ext.form.DisplayField
17 * @extends Ext.form.Field
18 * A display-only text field which is not validated and not submitted.
20 * Creates a new DisplayField.
21 * @param {Object} config Configuration options
24 Ext.form.DisplayField = Ext.extend(Ext.form.Field, {
25 validationEvent : false,
26 validateOnBlur : false,
27 defaultAutoCreate : {tag: "div"},
28 <div id="cfg-Ext.form.DisplayField-fieldClass"></div>/**
29 * @cfg {String} fieldClass The default CSS class for the field (defaults to <tt>"x-form-display-field"</tt>)
31 fieldClass : "x-form-display-field",
32 <div id="cfg-Ext.form.DisplayField-htmlEncode"></div>/**
33 * @cfg {Boolean} htmlEncode <tt>false</tt> to skip HTML-encoding the text when rendering it (defaults to
34 * <tt>false</tt>). This might be useful if you want to include tags in the field's innerHTML rather than
35 * rendering them as string literals per the default logic.
40 initEvents : Ext.emptyFn,
46 validate : function(){
50 getRawValue : function(){
51 var v = this.rendered ? this.el.dom.innerHTML : Ext.value(this.value, '');
52 if(v === this.emptyText){
56 v = Ext.util.Format.htmlDecode(v);
61 getValue : function(){
62 return this.getRawValue();
69 setRawValue : function(v){
71 v = Ext.util.Format.htmlEncode(v);
73 return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = v);
76 setValue : function(v){
80 <div id="cfg-Ext.form.DisplayField-inputType"></div>/**
81 * @cfg {String} inputType
84 <div id="cfg-Ext.form.DisplayField-disabled"></div>/**
85 * @cfg {Boolean} disabled
88 <div id="cfg-Ext.form.DisplayField-readOnly"></div>/**
89 * @cfg {Boolean} readOnly
92 <div id="cfg-Ext.form.DisplayField-validateOnBlur"></div>/**
93 * @cfg {Boolean} validateOnBlur
96 <div id="cfg-Ext.form.DisplayField-validationDelay"></div>/**
97 * @cfg {Number} validationDelay
100 <div id="cfg-Ext.form.DisplayField-validationEvent"></div>/**
101 * @cfg {String/Boolean} validationEvent
106 Ext.reg('displayfield', Ext.form.DisplayField);