4 * This grid demonstrates row editing capabilities.
6 Ext.require('Ext.data.Store');
7 Ext.require('Ext.grid.Panel');
8 Ext.require('Ext.form.field.Text');
9 Ext.require('Ext.form.field.Date');
10 Ext.require('Ext.form.field.Display');
11 Ext.require('Ext.grid.plugin.RowEditing');
14 extend: 'Ext.data.Model',
16 { name: 'name', type: 'string' },
17 { name: 'email', type: 'string' },
18 { name: 'phone', type: 'string' },
19 { name: 'birthDate', type: 'date' }
23 Ext.onReady(function() {
25 var userStore = Ext.create('Ext.data.Store', {
29 { name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224', birthDate: new Date(1981, 9, 28) },
30 { name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234', birthDate: new Date(1979, 4, 1) },
31 { name: 'Homer', email: 'home@simpsons.com', phone: '555-222-1244', birthDate: new Date(1956, 3, 15) },
32 { name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254', birthDate: new Date(1954, 10, 1) }
46 Ext.create('Ext.grid.Panel', {
47 renderTo: Ext.getBody(),
51 title: 'Application Users',
59 //use a Ext.form.field.Text as the editor
61 //prevent empty values from being inserted into this field
66 text: 'Email Address',
69 //use a Ext.form.field.Text as the editor
80 dataIndex: 'birthDate',
81 //use a Ext.form.field.Date as the editor
83 // format the date using a renderer from the Ext.util.Format class
84 renderer: Ext.util.Format.dateRenderer('m/d/Y')
89 Ext.create('Ext.grid.plugin.RowEditing', {