3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.1
11 * Copyright(c) 2006-2010 Sencha Inc.
12 * licensing@sencha.com
13 * http://www.sencha.com/license
15 <div id="cls-Ext.grid.RowNumberer"></div>/**
16 * @class Ext.grid.RowNumberer
17 * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides
18 * an automatic row numbering column.
21 // This is a typical column config with the first column providing row numbers
22 var colModel = new Ext.grid.ColumnModel([
23 new Ext.grid.RowNumberer(),
24 {header: "Name", width: 80, sortable: true},
25 {header: "Code", width: 50, sortable: true},
26 {header: "Description", width: 200, sortable: true}
30 * @param {Object} config The configuration options
32 Ext.grid.RowNumberer = Ext.extend(Object, {
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).
48 constructor : function(config){
49 Ext.apply(this, config);
51 this.renderer = this.renderer.createDelegate(this);
64 renderer : function(v, p, record, rowIndex){
66 p.cellAttr = 'rowspan="'+this.rowspan+'"';