DisplayField_wev8.js
2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*!
* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
/**
* @class Ext.form.DisplayField
* @extends Ext.form.Field
* A display-only text field which is not validated and not submitted.
* @constructor
* Creates a new DisplayField.
* @param {Object} config Configuration options
* @xtype displayfield
*/
Ext.form.DisplayField = Ext.extend(Ext.form.Field, {
validationEvent : false,
validateOnBlur : false,
defaultAutoCreate : {tag: "div"},
/**
* @cfg {String} fieldClass The default CSS class for the field (defaults to <tt>"x-form-display-field"</tt>)
*/
fieldClass : "x-form-display-field",
/**
* @cfg {Boolean} htmlEncode <tt>false</tt> to skip HTML-encoding the text when rendering it (defaults to
* <tt>false</tt>). This might be useful if you want to include tags in the field's innerHTML rather than
* rendering them as string literals per the default logic.
*/
htmlEncode: false,
// private
initEvents : Ext.emptyFn,
isValid : function(){
return true;
},
validate : function(){
return true;
},
getRawValue : function(){
var v = this.rendered ? this.el.dom.innerHTML : Ext.value(this.value, '');
if(v === this.emptyText){
v = '';
}
if(this.htmlEncode){
v = Ext.util.Format.htmlDecode(v);
}
return v;
},
getValue : function(){
return this.getRawValue();
},
getName: function() {
return this.name;
},
setRawValue : function(v){
if(this.htmlEncode){
v = Ext.util.Format.htmlEncode(v);
}
return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = v);
},
setValue : function(v){
this.setRawValue(v);
return this;
}
/**
* @cfg {String} inputType
* @hide
*/
/**
* @cfg {Boolean} disabled
* @hide
*/
/**
* @cfg {Boolean} readOnly
* @hide
*/
/**
* @cfg {Boolean} validateOnBlur
* @hide
*/
/**
* @cfg {Number} validationDelay
* @hide
*/
/**
* @cfg {String/Boolean} validationEvent
* @hide
*/
});
Ext.reg('displayfield', Ext.form.DisplayField);