3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.grid.RowNumberer"></div>/**
15 * @class Ext.grid.RowNumberer
16 * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides
17 * an automatic row numbering column.
20 // This is a typical column config with the first column providing row numbers
21 var colModel = new Ext.grid.ColumnModel([
22 new Ext.grid.RowNumberer(),
23 {header: "Name", width: 80, sortable: true},
24 {header: "Code", width: 50, sortable: true},
25 {header: "Description", width: 200, sortable: true}
29 * @param {Object} config The configuration options
31 Ext.grid.RowNumberer = function(config){
32 Ext.apply(this, config);
34 this.renderer = this.renderer.createDelegate(this);
38 Ext.grid.RowNumberer.prototype = {
39 <div id="cfg-Ext.grid.RowNumberer-header"></div>/**
40 * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row
41 * number column (defaults to '').
44 <div id="cfg-Ext.grid.RowNumberer-width"></div>/**
45 * @cfg {Number} width The default width in pixels of the row number column (defaults to 23).
48 <div id="cfg-Ext.grid.RowNumberer-sortable"></div>/**
49 * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false).
62 renderer : function(v, p, record, rowIndex){
64 p.cellAttr = 'rowspan="'+this.rowspan+'"';