You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
4.1 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  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; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-form-DisplayField-method-constructor'><span id='Ext-form-DisplayField'>/**
  19. </span></span> * @class Ext.form.DisplayField
  20. * @extends Ext.form.Field
  21. * A display-only text field which is not validated and not submitted.
  22. * @constructor
  23. * Creates a new DisplayField.
  24. * @param {Object} config Configuration options
  25. * @xtype displayfield
  26. */
  27. Ext.form.DisplayField = Ext.extend(Ext.form.Field, {
  28. <span id='Ext-form-DisplayField-cfg-validationEvent'> validationEvent : false,
  29. </span><span id='Ext-form-DisplayField-cfg-validateOnBlur'> validateOnBlur : false,
  30. </span><span id='Ext-form-DisplayField-property-defaultAutoCreate'> defaultAutoCreate : {tag: &quot;div&quot;},
  31. </span><span id='Ext-form-DisplayField-cfg-fieldClass'> /**
  32. </span> * @cfg {String} fieldClass The default CSS class for the field (defaults to &lt;tt&gt;&quot;x-form-display-field&quot;&lt;/tt&gt;)
  33. */
  34. fieldClass : &quot;x-form-display-field&quot;,
  35. <span id='Ext-form-DisplayField-cfg-htmlEncode'> /**
  36. </span> * @cfg {Boolean} htmlEncode &lt;tt&gt;false&lt;/tt&gt; to skip HTML-encoding the text when rendering it (defaults to
  37. * &lt;tt&gt;false&lt;/tt&gt;). This might be useful if you want to include tags in the field's innerHTML rather than
  38. * rendering them as string literals per the default logic.
  39. */
  40. htmlEncode: false,
  41. <span id='Ext-form-DisplayField-method-initEvents'> // private
  42. </span> initEvents : Ext.emptyFn,
  43. <span id='Ext-form-DisplayField-method-isValid'> isValid : function(){
  44. </span> return true;
  45. },
  46. <span id='Ext-form-DisplayField-method-validate'> validate : function(){
  47. </span> return true;
  48. },
  49. <span id='Ext-form-DisplayField-method-getRawValue'> getRawValue : function(){
  50. </span> var v = this.rendered ? this.el.dom.innerHTML : Ext.value(this.value, '');
  51. if(v === this.emptyText){
  52. v = '';
  53. }
  54. if(this.htmlEncode){
  55. v = Ext.util.Format.htmlDecode(v);
  56. }
  57. return v;
  58. },
  59. <span id='Ext-form-DisplayField-method-getValue'> getValue : function(){
  60. </span> return this.getRawValue();
  61. },
  62. <span id='Ext-form-DisplayField-method-getName'> getName: function() {
  63. </span> return this.name;
  64. },
  65. <span id='Ext-form-DisplayField-method-setRawValue'> setRawValue : function(v){
  66. </span> if(this.htmlEncode){
  67. v = Ext.util.Format.htmlEncode(v);
  68. }
  69. return this.rendered ? (this.el.dom.innerHTML = (Ext.isEmpty(v) ? '' : v)) : (this.value = v);
  70. },
  71. <span id='Ext-form-DisplayField-method-setValue'> setValue : function(v){
  72. </span> this.setRawValue(v);
  73. return this;
  74. }
  75. <span id='Ext-form-DisplayField-cfg-inputType'> /**
  76. </span> * @cfg {String} inputType
  77. * @hide
  78. */
  79. <span id='Ext-form-DisplayField-cfg-disabled'> /**
  80. </span> * @cfg {Boolean} disabled
  81. * @hide
  82. */
  83. <span id='Ext-form-DisplayField-cfg-readOnly'> /**
  84. </span> * @cfg {Boolean} readOnly
  85. * @hide
  86. */
  87. <span id='Ext-form-DisplayField-cfg-validateOnBlur'> /**
  88. </span> * @cfg {Boolean} validateOnBlur
  89. * @hide
  90. */
  91. <span id='Ext-form-DisplayField-cfg-validationDelay'> /**
  92. </span> * @cfg {Number} validationDelay
  93. * @hide
  94. */
  95. <span id='Ext-form-DisplayField-cfg-validationEvent'> /**
  96. </span> * @cfg {String/Boolean} validationEvent
  97. * @hide
  98. */
  99. });
  100. Ext.reg('displayfield', Ext.form.DisplayField);
  101. </pre>
  102. </body>
  103. </html>