1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-grid.RowNumberer-method-constructor'><span id='Ext-grid.RowNumberer'>/**
2 </span></span> * @class Ext.grid.RowNumberer
3 * @extends Ext.grid.column.Column
4 * This is a utility class that can be passed into a {@link Ext.grid.column.Column} as a column config that provides
5 * an automatic row numbering column.
6 * <br>Usage:<br><pre><code>
8 Ext.create('Ext.grid.RowNumberer'),
9 {text: "Company", flex: 1, sortable: true, dataIndex: 'company'},
10 {text: "Price", width: 120, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
11 {text: "Change", width: 120, sortable: true, dataIndex: 'change'},
12 {text: "% Change", width: 120, sortable: true, dataIndex: 'pctChange'},
13 {text: "Last Updated", width: 120, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
15 *</code></pre>
17 * @param {Object} config The configuration options
19 Ext.define('Ext.grid.RowNumberer', {
20 extend: 'Ext.grid.column.Column',
21 alias: 'widget.rownumberer',
22 <span id='Ext-grid.RowNumberer-cfg-text'> /**
23 </span> * @cfg {String} text Any valid text or HTML fragment to display in the header cell for the row
24 * number column (defaults to '&#160').
26 text: "&#160",
28 <span id='Ext-grid.RowNumberer-cfg-width'> /**
29 </span> * @cfg {Number} width The default width in pixels of the row number column (defaults to 23).
33 <span id='Ext-grid.RowNumberer-cfg-sortable'> /**
34 </span> * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false).
41 constructor : function(config){
42 this.callParent(arguments);
44 this.renderer = Ext.Function.bind(this.renderer, this);
53 cls: Ext.baseCSSPrefix + 'row-numberer',
57 renderer: function(value, metaData, record, rowIdx, colIdx, store) {
59 metaData.cellAttr = 'rowspan="'+this.rowspan+'"';
62 metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special';
63 return store.indexOfTotal(record) + 1;
66 </pre></pre></body></html>