2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
10 * @class Ext.grid.RowNumberer
\r
11 * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides
\r
12 * an automatic row numbering column.
\r
15 // This is a typical column config with the first column providing row numbers
\r
16 var colModel = new Ext.grid.ColumnModel([
\r
17 new Ext.grid.RowNumberer(),
\r
18 {header: "Name", width: 80, sortable: true},
\r
19 {header: "Code", width: 50, sortable: true},
\r
20 {header: "Description", width: 200, sortable: true}
\r
24 * @param {Object} config The configuration options
\r
26 Ext.grid.RowNumberer = function(config){
\r
27 Ext.apply(this, config);
\r
29 this.renderer = this.renderer.createDelegate(this);
\r
33 Ext.grid.RowNumberer.prototype = {
\r
35 * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row
\r
36 * number column (defaults to '').
\r
40 * @cfg {Number} width The default width in pixels of the row number column (defaults to 23).
\r
44 * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false).
\r
57 renderer : function(v, p, record, rowIndex){
\r
59 p.cellAttr = 'rowspan="'+this.rowspan+'"';
\r