Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / RowNumberer.html
diff --git a/docs/source/RowNumberer.html b/docs/source/RowNumberer.html
new file mode 100644 (file)
index 0000000..8e2ff23
--- /dev/null
@@ -0,0 +1,64 @@
+<html>\r
+<head>\r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js"><div id="cls-Ext.grid.RowNumberer"></div>/**
+ * @class Ext.grid.RowNumberer
+ * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides
+ * an automatic row numbering column.
+ * <br>Usage:<br>
+ <pre><code>
+ // This is a typical column config with the first column providing row numbers
+ var colModel = new Ext.grid.ColumnModel([
+    new Ext.grid.RowNumberer(),
+    {header: "Name", width: 80, sortable: true},
+    {header: "Code", width: 50, sortable: true},
+    {header: "Description", width: 200, sortable: true}
+ ]);
+ </code></pre>
+ * @constructor
+ * @param {Object} config The configuration options
+ */
+Ext.grid.RowNumberer = function(config){
+    Ext.apply(this, config);
+    if(this.rowspan){
+        this.renderer = this.renderer.createDelegate(this);
+    }
+};
+
+Ext.grid.RowNumberer.prototype = {
+    <div id="cfg-Ext.grid.RowNumberer-header"></div>/**
+     * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row
+     * number column (defaults to '').
+     */
+    header: "",
+    <div id="cfg-Ext.grid.RowNumberer-width"></div>/**
+     * @cfg {Number} width The default width in pixels of the row number column (defaults to 23).
+     */
+    width: 23,
+    <div id="cfg-Ext.grid.RowNumberer-sortable"></div>/**
+     * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false).
+     * @hide
+     */
+    sortable: false,
+
+    // private
+    fixed:true,
+    menuDisabled:true,
+    dataIndex: '',
+    id: 'numberer',
+    rowspan: undefined,
+
+    // private
+    renderer : function(v, p, record, rowIndex){
+        if(this.rowspan){
+            p.cellAttr = 'rowspan="'+this.rowspan+'"';
+        }
+        return rowIndex+1;
+    }
+};</pre>    \r
+</body>\r
+</html>
\ No newline at end of file