3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.grid.RowNumberer"></div>/**
10 * @class Ext.grid.RowNumberer
11 * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides
12 * an automatic row numbering column.
15 // This is a typical column config with the first column providing row numbers
16 var colModel = new Ext.grid.ColumnModel([
17 new Ext.grid.RowNumberer(),
18 {header: "Name", width: 80, sortable: true},
19 {header: "Code", width: 50, sortable: true},
20 {header: "Description", width: 200, sortable: true}
24 * @param {Object} config The configuration options
26 Ext.grid.RowNumberer = Ext.extend(Object, {
27 <div id="cfg-Ext.grid.RowNumberer-header"></div>/**
28 * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row
29 * number column (defaults to '').
32 <div id="cfg-Ext.grid.RowNumberer-width"></div>/**
33 * @cfg {Number} width The default width in pixels of the row number column (defaults to 23).
36 <div id="cfg-Ext.grid.RowNumberer-sortable"></div>/**
37 * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false).
42 constructor : function(config){
43 Ext.apply(this, config);
45 this.renderer = this.renderer.createDelegate(this);
57 renderer : function(v, p, record, rowIndex){
59 p.cellAttr = 'rowspan="'+this.rowspan+'"';