My mode
Code:
Ext.define('MyApp.model.User', {
extend: 'Ext.data.Model',
fields: [
'firstName', 'lastName', 'phoneNumber', 'email'
],
});
My store
Code:
Ext.define('MyApp.store.Users', {
extend: 'Ext.data.Store',
model: 'MyApp.model.User',
alias: 'store.users',
requires: [
'MyApp.model.User'
],
data: [
{ firstName: 'Jean', lastName: 'Grey', phoneNumber: '(321) 341-2312', email: '[email protected]' },
{ firstName: 'Phillip', lastName: 'Fry', phoneNumber: '(421) 321-5531', email: '[email protected]'},
{ firstName: 'Peter', lastName: 'Quill', phoneNumber: '(412) 323-9312', email: '[email protected]' },
],
});
My grid.
Code:
Ext.define('MyApp.view.main.UserList', {
extend: 'Ext.grid.Panel',
alias: 'widget.mainUserList',
requires: [
'Ext.form.field.Text',
'Ext.grid.column.RowNumberer',
'Ext.grid.plugin.RowEditing',
'MyApp.store.Users'
],
plugins: [
{
ptype: 'rowediting',
clicksToEdit: 2,
},
],
selType: 'rowmodel',
store: {
type: 'users',
},
tbar:
[
{
text: 'Add Plant',
handler: 'addOnButtonClick',
},
],
columns: [
{
xtype: 'rownumberer',
},
{
text: 'Name',
dataIndex: 'firstName',
flex: 1,
editor:
{
xtype: 'textfield',
allowBlank: false,
}
},
{
text: 'Surname',
dataIndex: 'lastName',
flex: 1,
editor:
{
xtype: 'textfield',
allowBlank: false,
}
},
{
text: 'Phone Number',
dataIndex: 'phoneNumber',
flex: 1,
editor:
{
xtype: 'textfield',
allowBlank: false,
}
},
{
text: 'eMail',
dataIndex: 'email',
flex: 1,
editor:
{
vtype: 'email',
allowBlank: false,
}
},
],
});
I can to change on lochalhost, but app doesn't save my changes. Can u help me?