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.

171 lines
7.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-list-Column'>/**
  19. </span> * @class Ext.list.Column
  20. * &lt;p&gt;This class encapsulates column configuration data to be used in the initialization of a
  21. * {@link Ext.list.ListView ListView}.&lt;/p&gt;
  22. * &lt;p&gt;While subclasses are provided to render data in different ways, this class renders a passed
  23. * data field unchanged and is usually used for textual columns.&lt;/p&gt;
  24. */
  25. Ext.list.Column = Ext.extend(Object, {
  26. <span id='Ext-list-Column-cfg-isColumn'> /**
  27. </span> * @private
  28. * @cfg {Boolean} isColumn
  29. * Used by ListView constructor method to avoid reprocessing a Column
  30. * if &lt;code&gt;isColumn&lt;/code&gt; is not set ListView will recreate a new Ext.list.Column
  31. * Defaults to true.
  32. */
  33. isColumn: true,
  34. <span id='Ext-list-Column-cfg-align'> /**
  35. </span> * @cfg {String} align
  36. * Set the CSS text-align property of the column. Defaults to &lt;tt&gt;'left'&lt;/tt&gt;.
  37. */
  38. align: 'left',
  39. <span id='Ext-list-Column-cfg-header'> /**
  40. </span> * @cfg {String} header Optional. The header text to be used as innerHTML
  41. * (html tags are accepted) to display in the ListView. &lt;b&gt;Note&lt;/b&gt;: to
  42. * have a clickable header with no text displayed use &lt;tt&gt;'&amp;#160;'&lt;/tt&gt;.
  43. */
  44. header: '',
  45. <span id='Ext-list-Column-cfg-width'> /**
  46. </span> * @cfg {Number} width Optional. Percentage of the container width
  47. * this column should be allocated. Columns that have no width specified will be
  48. * allocated with an equal percentage to fill 100% of the container width. To easily take
  49. * advantage of the full container width, leave the width of at least one column undefined.
  50. * Note that if you do not want to take up the full width of the container, the width of
  51. * every column needs to be explicitly defined.
  52. */
  53. width: null,
  54. <span id='Ext-list-Column-cfg-cls'> /**
  55. </span> * @cfg {String} cls Optional. This option can be used to add a CSS class to the cell of each
  56. * row for this column.
  57. */
  58. cls: '',
  59. <span id='Ext-list-Column-cfg-tpl'> /**
  60. </span> * @cfg {String} tpl Optional. Specify a string to pass as the
  61. * configuration string for {@link Ext.XTemplate}. By default an {@link Ext.XTemplate}
  62. * will be implicitly created using the &lt;tt&gt;dataIndex&lt;/tt&gt;.
  63. */
  64. <span id='Ext-list-Column-cfg-dataIndex'> /**
  65. </span> * @cfg {String} dataIndex &lt;p&gt;&lt;b&gt;Required&lt;/b&gt;. The name of the field in the
  66. * ListViews's {@link Ext.data.Store}'s {@link Ext.data.Record} definition from
  67. * which to draw the column's value.&lt;/p&gt;
  68. */
  69. constructor : function(c){
  70. if(!c.tpl){
  71. c.tpl = new Ext.XTemplate('{' + c.dataIndex + '}');
  72. }
  73. else if(Ext.isString(c.tpl)){
  74. c.tpl = new Ext.XTemplate(c.tpl);
  75. }
  76. Ext.apply(this, c);
  77. }
  78. });
  79. Ext.reg('lvcolumn', Ext.list.Column);
  80. <span id='Ext-list-NumberColumn'>/**
  81. </span> * @class Ext.list.NumberColumn
  82. * @extends Ext.list.Column
  83. * &lt;p&gt;A Column definition class which renders a numeric data field according to a {@link #format} string. See the
  84. * {@link Ext.list.Column#xtype xtype} config option of {@link Ext.list.Column} for more details.&lt;/p&gt;
  85. */
  86. Ext.list.NumberColumn = Ext.extend(Ext.list.Column, {
  87. <span id='Ext-list-NumberColumn-cfg-format'> /**
  88. </span> * @cfg {String} format
  89. * A formatting string as used by {@link Ext.util.Format#number} to format a numeric value for this Column
  90. * (defaults to &lt;tt&gt;'0,000.00'&lt;/tt&gt;).
  91. */
  92. format: '0,000.00',
  93. <span id='Ext-list-NumberColumn-method-constructor'> constructor : function(c) {
  94. </span> c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':number(&quot;' + (c.format || this.format) + '&quot;)}');
  95. Ext.list.NumberColumn.superclass.constructor.call(this, c);
  96. }
  97. });
  98. Ext.reg('lvnumbercolumn', Ext.list.NumberColumn);
  99. <span id='Ext-list-DateColumn'>/**
  100. </span> * @class Ext.list.DateColumn
  101. * @extends Ext.list.Column
  102. * &lt;p&gt;A Column definition class which renders a passed date according to the default locale, or a configured
  103. * {@link #format}. See the {@link Ext.list.Column#xtype xtype} config option of {@link Ext.list.Column}
  104. * for more details.&lt;/p&gt;
  105. */
  106. Ext.list.DateColumn = Ext.extend(Ext.list.Column, {
  107. <span id='Ext-list-DateColumn-property-format'> format: 'm/d/Y',
  108. </span><span id='Ext-list-DateColumn-method-constructor'> constructor : function(c) {
  109. </span> c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':date(&quot;' + (c.format || this.format) + '&quot;)}');
  110. Ext.list.DateColumn.superclass.constructor.call(this, c);
  111. }
  112. });
  113. Ext.reg('lvdatecolumn', Ext.list.DateColumn);
  114. <span id='Ext-list-BooleanColumn'>/**
  115. </span> * @class Ext.list.BooleanColumn
  116. * @extends Ext.list.Column
  117. * &lt;p&gt;A Column definition class which renders boolean data fields. See the {@link Ext.list.Column#xtype xtype}
  118. * config option of {@link Ext.list.Column} for more details.&lt;/p&gt;
  119. */
  120. Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, {
  121. <span id='Ext-list-BooleanColumn-cfg-trueText'> /**
  122. </span> * @cfg {String} trueText
  123. * The string returned by the renderer when the column value is not falsey (defaults to &lt;tt&gt;'true'&lt;/tt&gt;).
  124. */
  125. trueText: 'true',
  126. <span id='Ext-list-BooleanColumn-cfg-falseText'> /**
  127. </span> * @cfg {String} falseText
  128. * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to
  129. * &lt;tt&gt;'false'&lt;/tt&gt;).
  130. */
  131. falseText: 'false',
  132. <span id='Ext-list-BooleanColumn-cfg-undefinedText'> /**
  133. </span> * @cfg {String} undefinedText
  134. * The string returned by the renderer when the column value is undefined (defaults to &lt;tt&gt;'&amp;#160;'&lt;/tt&gt;).
  135. */
  136. undefinedText: '&amp;#160;',
  137. <span id='Ext-list-BooleanColumn-method-constructor'> constructor : function(c) {
  138. </span> c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}');
  139. var t = this.trueText, f = this.falseText, u = this.undefinedText;
  140. c.tpl.format = function(v){
  141. if(v === undefined){
  142. return u;
  143. }
  144. if(!v || v === 'false'){
  145. return f;
  146. }
  147. return t;
  148. };
  149. Ext.list.DateColumn.superclass.constructor.call(this, c);
  150. }
  151. });
  152. Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn);</pre>
  153. </body>
  154. </html>