i created a basic sencha project via cmd:
sencha -sdk path/to/SDK generate app classic SandBox path/to/TARGET
in addition i changed the the data to a Personel.json
{ "items": [
{ "name": "Jean Luc", "email": "[email protected]", "phone": "555-111-1111" },
{ "name": "Worf", "email": "[email protected]", "phone": "555-222-2222" },
{ "name": "Deanna", "email": "[email protected]", "phone": "555-333-3333" },
{ "name": "Data", "email": "[email protected]", "phone": "555-444-4444" }]}
store.Personnel.js
Ext.define('SandBox.store.Personnel', {
extend: 'Ext.data.Store',
alias: 'store.personnel',
autoLoad: true,
autoSync: true,
loading: true,
model: 'SandBox.model.Personnel',
proxy: {
type: 'ajax',
url: 'resources/json/Personnel.json',
reader: {
type: 'json',
rootProperty: 'items'
}
}
});
now i want to edit the values inside the table with the rowediting plugin. view.main.List.js
Ext.define('SandBox.view.main.List',{
extend: 'Ext.grid.Panel',
xtype: 'mainlist',
requires: [
'SandBox.store.Personnel'
],
title: 'Personnel',
store: {
type: 'personnel'
},
plugins: {
ptype: 'rowediting'
},
columns: [{
text: 'Name', dataIndex: 'name',
editor:{
xtype: 'textfield',
emptyText: 'Name'
}},{
text: 'Email',
dataIndex: 'email',
flex: 1,
editor:{
xtype: 'textfield',
emptyText: 'Email'
}},{
text: 'Phone',
dataIndex: 'phone',
flex: 1 ,
editor:{
xtype: 'textfield',
emptyText: 'Phone'
}}
]});
if i try to change any value of the table always the first entry of the Personnel.json will insert in the whole row. so i try to disable the POST function from the update button and keep the changed data localy in cause i haven't actualy any backend. later i want to send explicit the POST request by a seperate "Send" button. i tried to customize the rowediting plugin like this in addition i changed the autoCancel in autoUpdate.
rowediting: {
clicksToMoveEditor: 1,
autoUpdate: false,
useButtonText: false,
saveBtnIconCls: 'fa fa-check green-color',
cancelBtnIconCls: 'fa fa-times red-color'
}
this way i get the following error:
Error: [Ext.createByAlias] Unrecognized alias: plugin.null ext-all-rtl-debug.js:15041:27
instantiateByAlias
http://localhost:1841/ext/build/ext-all-rtl-debug.js:15041:27
create
http://localhost:1841/ext/build/ext-all-rtl-debug.js:241654:26
constructPlugin
http://localhost:1841/ext/build/ext-all-rtl-debug.js:70680:26
constructPlugins
http://localhost:1841/ext/build/ext-all-rtl-debug.js:70708:33
initComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:200605:26
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
initComponent
http://localhost:1841/ext/classic/theme-neptune/overrides/panel/Table.js:9:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:67285:9
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:200554:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:13168:20
widget
http://localhost:1841/ext/build/ext-all-rtl-debug.js:15582:20
create
http://localhost:1841/ext/build/ext-all-rtl-debug.js:27456:16
lookupComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:140073:20
prepareItems
http://localhost:1841/ext/build/ext-all-rtl-debug.js:140658:32
add
http://localhost:1841/ext/build/ext-all-rtl-debug.js:139552:23
initItems
http://localhost:1841/ext/build/ext-all-rtl-debug.js:139975:17
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
initItems
http://localhost:1841/ext/build/ext-all-rtl-debug.js:161148:9
initComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:139936:9
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
initComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:161137:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:67285:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:13168:20
widget
http://localhost:1841/ext/build/ext-all-rtl-debug.js:15582:20
create
http://localhost:1841/ext/build/ext-all-rtl-debug.js:27456:16
lookupComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:140073:20
prepareItems
http://localhost:1841/ext/build/ext-all-rtl-debug.js:140658:32
add
http://localhost:1841/ext/build/ext-all-rtl-debug.js:139552:23
initItems
http://localhost:1841/ext/build/ext-all-rtl-debug.js:139975:17
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
initItems
http://localhost:1841/ext/build/ext-all-rtl-debug.js:161148:9
initComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:139936:9
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
initComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:161137:9
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
initComponent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:247719:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:67285:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:13168:20
anonymous
http://localhost:1841/ext/build/ext-all-rtl-debug.js:3:8
create
http://localhost:1841/ext/build/ext-all-rtl-debug.js:15525:20
create
http://localhost:1841/ext/build/ext-all-rtl-debug.js:11458:20
applyMainView
http://localhost:1841/ext/build/ext-all-rtl-debug.js:96557:16
setter
http://localhost:1841/ext/build/ext-all-rtl-debug.js:10577:57
makeInitGetter/<
http://localhost:1841/ext/build/ext-all-rtl-debug.js:10556:24
initMainView
http://localhost:1841/ext/build/ext-all-rtl-debug.js:96329:13
onBeforeLaunch
http://localhost:1841/ext/build/ext-all-rtl-debug.js:96283:9
callParent
http://localhost:1841/ext/build/ext-all-rtl-debug.js:12525:20
onBeforeLaunch
http://localhost:1841/ext/build/ext-all-rtl-debug.js:96585:9
onProfilesReady
http://localhost:1841/ext/build/ext-all-rtl-debug.js:96217:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:96186:9
constructor
http://localhost:1841/ext/build/ext-all-rtl-debug.js:13168:20
createApp/<
http://localhost:1841/ext/build/ext-all-rtl-debug.js:96483:48
invoke
http://localhost:1841/ext/build/ext-all-rtl-debug.js:18581:17
doInvokeAll
http://localhost:1841/ext/build/ext-all-rtl-debug.js:18625:13
invokeAll
http://localhost:1841/ext/build/ext-all-rtl-debug.js:18594:13
handleReady
http://localhost:1841/ext/build/ext-all-rtl-debug.js:18550:13
handleReadySoon/me.timer<
http://localhost:1841/ext/build/ext-all-rtl-debug.js:18565:17
bind/<
http://localhost:1841/ext/build/ext-all-rtl-debug.js:6891:28
defer/<
http://localhost:1841/ext/build/ext-all-rtl-debug.js:7088:29
so i tried to override the plugin like this an add a new RoweditPlugin.js
Ext.grid.plugin.RowEditorButtons.override({
constructor: function(config)
{
var me = this,
rowEditor = config.rowEditor,
editPlugin = rowEditor.editingPlugin;
me.callParent(arguments);
me.insert(0,
{
cls: Ext.baseCSSPrefis + 'row-editor-update-button',
itemId: 'nbtn',
handler: editPlugin.newSave,
text: 'Update Local',
disabled: rowEditor.updateButtonDisabled
});
},
newSave: function(button)
{
this.completeEdit();
}
});
and changed the call from the plugin in List.js
plugins: {
ptype: 'rowediting',
autoUpdate: false
},
but now the rowEditPlugin is uneffected by my override. what can i do to change the default functionallity from the update button?