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.column.Number'>/**
2 </span> * @class Ext.grid.column.Number
3 * @extends Ext.grid.column.Column
5 * A Column definition class which renders a numeric data field according to a {@link #format} string.
7 * {@img Ext.grid.column.Number/Ext.grid.column.Number.png Ext.grid.column.Number cell editing}
10 * Ext.create('Ext.data.Store', {
11 * storeId:'sampleStore',
13 * {name: 'symbol', type: 'string'},
14 * {name: 'price', type: 'number'},
15 * {name: 'change', type: 'number'},
16 * {name: 'volume', type: 'number'},
19 * {symbol:"msft", price:25.76, change:2.43, volume:61606325},
20 * {symbol:"goog", price:525.73, change:0.81, volume:3053782},
21 * {symbol:"apple", price:342.41, change:1.35, volume:24484858},
22 * {symbol:"sencha", price:142.08, change:8.85, volume:5556351}
26 * Ext.create('Ext.grid.Panel', {
27 * title: 'Number Column Demo',
28 * store: Ext.data.StoreManager.lookup('sampleStore'),
30 * {text: 'Symbol', dataIndex: 'symbol', flex: 1},
31 * {text: 'Current Price', dataIndex: 'price', renderer: Ext.util.Format.usMoney},
32 * {text: 'Change', dataIndex: 'change', xtype: 'numbercolumn', format:'0.00'},
33 * {text: 'Volume', dataIndex: 'volume', xtype: 'numbercolumn', format:'0,000'}
37 * renderTo: Ext.getBody()
42 Ext.define('Ext.grid.column.Number', {
43 extend: 'Ext.grid.column.Column',
44 alias: ['widget.numbercolumn'],
45 requires: ['Ext.util.Format'],
46 alternateClassName: 'Ext.grid.NumberColumn',
48 <span id='Ext-grid.column.Number-cfg-format'> /**
49 </span> * @cfg {String} format
50 * A formatting string as used by {@link Ext.util.Format#number} to format a numeric value for this Column
51 * (defaults to <code>'0,000.00'</code>).
54 constructor: function(cfg) {
55 this.callParent(arguments);
56 this.renderer = Ext.util.Format.numberRenderer(this.format);
58 });</pre></pre></body></html>