ErnestoR
9 Feb 2012, 3:10 PM
Hello Forum,
I have a simple Grid Panel with the Roweditor plugin and I'm trying to listen to the event canceledit from a controller but it isn't firing.
GridPanel
Ext.define('Mx.view.grupoListGridPanel',{
extend: 'Ext.grid.Panel',
alias: 'widget.grupoListGridPanel',
title: 'Grupo',
store: 'grupo.queryGrupoAll',
plugins: [{
ptype: 'rowediting',
clicksToEdit: 2,
autoCancel: false
}],
columns: [
{
header: 'ID',
dataIndex: 'id'
},
{
header: 'Nombre',
dataIndex: 'nombre',
editor: {
xtype: 'textfield',
allowBlank: false
}
},
{
header: 'Descripcion',
dataIndex: 'descripcion',
editor: {
xtype: 'textfield',
allowBlank: false
}
}
]
});
Controller
Ext.define('Mx.controller.prospectoController',{
extend: 'Ext.app.Controller',
models:[
'grupo.grupoAll'
],
stores:[
'grupo.queryGrupoAll'
],
views: [
'grupoListGridPanel'
],
init: function() {
this.control({
'grupoListGridPanel' :{
edit: this.afterGrupoEdit,
canceledit: this.onCancelGrupoEdit
}
});
},
afterGrupoEdit: function(grid){
console.log(grid);
console.log('after edit');
this.getGrupoQueryGrupoAllStore().sync();
},
onCancelGrupoEdit: function(){
console.log('cancel');
}
});
The wierd thing is that the event edit IS firing and according to the documentation its fired by the plugin but it won't work with the event canceledit.
Am I doing something wrong??
I have a simple Grid Panel with the Roweditor plugin and I'm trying to listen to the event canceledit from a controller but it isn't firing.
GridPanel
Ext.define('Mx.view.grupoListGridPanel',{
extend: 'Ext.grid.Panel',
alias: 'widget.grupoListGridPanel',
title: 'Grupo',
store: 'grupo.queryGrupoAll',
plugins: [{
ptype: 'rowediting',
clicksToEdit: 2,
autoCancel: false
}],
columns: [
{
header: 'ID',
dataIndex: 'id'
},
{
header: 'Nombre',
dataIndex: 'nombre',
editor: {
xtype: 'textfield',
allowBlank: false
}
},
{
header: 'Descripcion',
dataIndex: 'descripcion',
editor: {
xtype: 'textfield',
allowBlank: false
}
}
]
});
Controller
Ext.define('Mx.controller.prospectoController',{
extend: 'Ext.app.Controller',
models:[
'grupo.grupoAll'
],
stores:[
'grupo.queryGrupoAll'
],
views: [
'grupoListGridPanel'
],
init: function() {
this.control({
'grupoListGridPanel' :{
edit: this.afterGrupoEdit,
canceledit: this.onCancelGrupoEdit
}
});
},
afterGrupoEdit: function(grid){
console.log(grid);
console.log('after edit');
this.getGrupoQueryGrupoAllStore().sync();
},
onCancelGrupoEdit: function(){
console.log('cancel');
}
});
The wierd thing is that the event edit IS firing and according to the documentation its fired by the plugin but it won't work with the event canceledit.
Am I doing something wrong??