Web Interface For Lite Argus Control modules
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.

167 lines
6.5 KiB

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