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