-<i>// create the Grid</i>
-<b>var</b> grid = <b>new</b> Ext.grid.EditorGridPanel({
- store: store,
- colModel: <b>new</b> Ext.grid.ColumnModel({
- columns: [
- {id:<em>'company'</em>, header: <em>'Company'</em>, width: 160, dataIndex: <em>'company'</em>},
- {header: <em>'Price'</em>, renderer: <em>'usMoney'</em>, dataIndex: <em>'price'</em>},
- {header: <em>'Change'</em>, renderer: change, dataIndex: <em>'change'</em>},
- {header: <em>'% Change'</em>, renderer: pctChange, dataIndex: <em>'pctChange'</em>},
- {header: <em>'Last Updated'</em>, width: 85,
- renderer: Ext.util.Format.dateRenderer(<em>'m/d/Y'</em>),
- dataIndex: <em>'lastChange'</em>}
- ],
- defaults: {
- sortable: true,
- width: 75
- }
- }),
- autoExpandColumn: <em>'company'</em>, <i>// match the id specified <b>in</b> the column model</i>
- height:350,
- width:600,
- title:<em>'Array Grid'</em>,
- tbar: [{
- text: <em>'Add Record'</em>,
- handler : <b>function</b>(){
- <b>var</b> defaultData = {
- change: 0,
- company: <em>'New Company'</em>,
- lastChange: (<b>new</b> Date()).clearTime(),
- pctChange: 0,
- price: 10
- };
- <b>var</b> recId = 3; <i>// provide unique id</i>
- <b>var</b> p = <b>new</b> store.recordType(defaultData, recId); <i>// create <b>new</b> record</i>
- grid.stopEditing();
- store.<a href="output/Ext.data.Store.html#Ext.data.Store-insert" ext:member="insert" ext:cls="Ext.data.Store">insert</a>(0, p); <i>// insert a <b>new</b> record into the store (also see <a href="output/Ext.data.Store.html#Ext.data.Store-add" ext:member="add" ext:cls="Ext.data.Store">add</a>)</i>
- grid.startEditing(0, 0);
- }
- }]
-});</code></pre></div></div></td><td class="msource">Store</td></tr></tbody></table><a id="Ext.data.Store-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Store-Store"></a><b><a href="source/Store.html#cls-Ext.data.Store">Store</a></b>( <code>Object config</code> )\r
+ <i>// create the Grid</i>
+ <b>var</b> grid = <b>new</b> Ext.grid.EditorGridPanel({
+ store: store,
+ colModel: <b>new</b> Ext.grid.ColumnModel({
+ columns: [
+ {id:<em>'company'</em>, header: <em>'Company'</em>, width: 160, dataIndex: <em>'company'</em>},
+ {header: <em>'Price'</em>, renderer: <em>'usMoney'</em>, dataIndex: <em>'price'</em>},
+ {header: <em>'Change'</em>, renderer: change, dataIndex: <em>'change'</em>},
+ {header: <em>'% Change'</em>, renderer: pctChange, dataIndex: <em>'pctChange'</em>},
+ {header: <em>'Last Updated'</em>, width: 85,
+ renderer: Ext.util.Format.dateRenderer(<em>'m/d/Y'</em>),
+ dataIndex: <em>'lastChange'</em>}
+ ],
+ defaults: {
+ sortable: true,
+ width: 75
+ }
+ }),
+ autoExpandColumn: <em>'company'</em>, <i>// match the id specified <b>in</b> the column model</i>
+ height:350,
+ width:600,
+ title:<em>'Array Grid'</em>,
+ tbar: [{
+ text: <em>'Add Record'</em>,
+ handler : <b>function</b>(){
+ <b>var</b> defaultData = {
+ change: 0,
+ company: <em>'New Company'</em>,
+ lastChange: (<b>new</b> Date()).clearTime(),
+ pctChange: 0,
+ price: 10
+ };
+ <b>var</b> recId = 3; <i>// provide unique id</i>
+ <b>var</b> p = <b>new</b> store.recordType(defaultData, recId); <i>// create <b>new</b> record</i>
+ grid.stopEditing();
+ store.<a href="output/Ext.data.Store.html#Ext.data.Store-insert" ext:member="insert" ext:cls="Ext.data.Store">insert</a>(0, p); <i>// insert a <b>new</b> record into the store (also see <a href="output/Ext.data.Store.html#Ext.data.Store-add" ext:member="add" ext:cls="Ext.data.Store">add</a>)</i>
+ grid.startEditing(0, 0);
+ }
+ }]
+ });</code></pre></div></div></td><td class="msource">Store</td></tr></tbody></table><a id="Ext.data.Store-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Store-Store"></a><b><a href="source/Store.html#cls-Ext.data.Store">Store</a></b>( <code>Object config</code> )\r