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.

71 lines
2.3 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.grid.RowNumberer"></div>/**
  16. * @class Ext.grid.RowNumberer
  17. * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides
  18. * an automatic row numbering column.
  19. * <br>Usage:<br>
  20. <pre><code>
  21. // This is a typical column config with the first column providing row numbers
  22. var colModel = new Ext.grid.ColumnModel([
  23. new Ext.grid.RowNumberer(),
  24. {header: "Name", width: 80, sortable: true},
  25. {header: "Code", width: 50, sortable: true},
  26. {header: "Description", width: 200, sortable: true}
  27. ]);
  28. </code></pre>
  29. * @constructor
  30. * @param {Object} config The configuration options
  31. */
  32. Ext.grid.RowNumberer = Ext.extend(Object, {
  33. <div id="cfg-Ext.grid.RowNumberer-header"></div>/**
  34. * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row
  35. * number column (defaults to '').
  36. */
  37. header: "",
  38. <div id="cfg-Ext.grid.RowNumberer-width"></div>/**
  39. * @cfg {Number} width The default width in pixels of the row number column (defaults to 23).
  40. */
  41. width: 23,
  42. <div id="cfg-Ext.grid.RowNumberer-sortable"></div>/**
  43. * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false).
  44. * @hide
  45. */
  46. sortable: false,
  47. constructor : function(config){
  48. Ext.apply(this, config);
  49. if(this.rowspan){
  50. this.renderer = this.renderer.createDelegate(this);
  51. }
  52. },
  53. // private
  54. fixed:true,
  55. hideable: false,
  56. menuDisabled:true,
  57. dataIndex: '',
  58. id: 'numberer',
  59. rowspan: undefined,
  60. // private
  61. renderer : function(v, p, record, rowIndex){
  62. if(this.rowspan){
  63. p.cellAttr = 'rowspan="'+this.rowspan+'"';
  64. }
  65. return rowIndex+1;
  66. }
  67. });</pre>
  68. </body>
  69. </html>