X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/RowNumberer.html diff --git a/docs/source/RowNumberer.html b/docs/source/RowNumberer.html index 77902fb1..4b958d5d 100644 --- a/docs/source/RowNumberer.html +++ b/docs/source/RowNumberer.html @@ -1,70 +1,83 @@ + + The source code - - + + + + - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** - * @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 + +
/**
+ * @class Ext.grid.RowNumberer
+ * @extends Ext.grid.column.Column
+ * This is a utility class that can be passed into a {@link Ext.grid.column.Column} as a column config that provides
  * an automatic row numbering column.
- * 
Usage:
-

- // 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}
- ]);
- 
- * @constructor - * @param {Object} config The configuration options + * <br>Usage:<br><pre><code> +columns: [ + Ext.create('Ext.grid.RowNumberer'), + {text: "Company", flex: 1, sortable: true, dataIndex: 'company'}, + {text: "Price", width: 120, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'}, + {text: "Change", width: 120, sortable: true, dataIndex: 'change'}, + {text: "% Change", width: 120, sortable: true, dataIndex: 'pctChange'}, + {text: "Last Updated", width: 120, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'} +] + *</code></pre> */ -Ext.grid.RowNumberer = function(config){ - Ext.apply(this, config); - if(this.rowspan){ - this.renderer = this.renderer.createDelegate(this); - } -}; - -Ext.grid.RowNumberer.prototype = { -
/** - * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row - * number column (defaults to ''). +Ext.define('Ext.grid.RowNumberer', { + extend: 'Ext.grid.column.Column', + alias: 'widget.rownumberer', + /** + * @cfg {String} text Any valid text or HTML fragment to display in the header cell for the row + * number column (defaults to '&#160'). */ - header: "", -
/** - * @cfg {Number} width The default width in pixels of the row number column (defaults to 23). + text: "&#160", + + /** + * @cfg {Number} width The default width in pixels of the row number column (defaults to 23). */ width: 23, -
/** - * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false). + + /** + * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false). * @hide */ sortable: false, + align: 'right', + + constructor : function(config){ + this.callParent(arguments); + if (this.rowspan) { + this.renderer = Ext.Function.bind(this.renderer, this); + } + }, + // private - fixed:true, - menuDisabled:true, + fixed: true, + hideable: false, + menuDisabled: true, dataIndex: '', - id: 'numberer', + cls: Ext.baseCSSPrefix + 'row-numberer', rowspan: undefined, // private - renderer : function(v, p, record, rowIndex){ - if(this.rowspan){ - p.cellAttr = 'rowspan="'+this.rowspan+'"'; + renderer: function(value, metaData, record, rowIdx, colIdx, store) { + if (this.rowspan){ + metaData.cellAttr = 'rowspan="'+this.rowspan+'"'; } - return rowIndex+1; + + metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special'; + return store.indexOfTotal(record) + 1; } -};
+}); +
- \ No newline at end of file +