PDA

View Full Version : event when a editable grid change value



occiso
3 Sep 2010, 1:25 AM
hi!

I'm searching the event that throw when a in a editable grid I change a value.

I try this (in the columngrid)

//hacemos que la columna del EditorGridPanel sea editable
var columnaEditable = new Ext.grid.ColumnModel(
[{
header: label['agente'],
id: 'nomUsr',
width: 150,
sortable: true,
dataIndex: 'nomUsr'
},{
header: ModificarIncentivosAgente['incentivocalculado'],
width: 80,
sortable: true,
dataIndex: 'totIncSis',
renderer: Ext.util.Format.euroMoney,
align: 'right'
},{
header: ModificarIncentivosAgente['incentivoreal'],
width: 80,
sortable: true,
dataIndex: 'totIncRhh',
renderer: Ext.util.Format.euroMoney,
align: 'right',
afteredit : function ( object ){
console.debug('afteredit:');
},
editor: new Ext.form.NumberField({ //podemos editar la columna
allowBlank: false,
allowNegative: false,
maxValue: 1000000,
change: function ( obj, newValue, oldValue ){
console.debug('change:');
actualizarTotalIncentivos();
}
})
}]
);
(in the store)


//STORE de alarmas plantillas para el GridPanel grAlaPlantilla
var stIncentivosUsr = new Ext.data.Store({
reader: new Ext.data.JsonReader({
totalProperty: 'json[0].numRegistros',
root: 'json[0].resultados',
fields: [
{ name: 'nomUsr', mapping: 'nomUsr' },
{ name: 'nomUsrDir', mapping: 'nomUsrDir' },
{ name: 'totIncSis', mapping: 'totIncSis' },
{ name: 'totIncRhh', mapping: 'totIncRhh' },
{ name: 'timModIncDir', mapping: 'timModIncDir' },
{ name: 'timEnvIncRhh', mapping: 'timEnvIncRhh' },
{ name: 'codUsrInc', mapping: 'codUsrInc' },
{ name: 'codUsrDir', mapping: 'codUsrDir' }
]/*,
id: 'ideIcp'*/
}),
remoteSort: true,
paramNames: {
"sort": "sortKey",
"dir": "sortOrder"
},
sortInfo: {
field: 'nomUsr',
direction: 'ASC'
},
autoLoad : false,
update : function ( store, record, operation ){
console.debug('store update:');
},
datachanged : function (store ) {
console.debug('store datachanged:');
},
url : contextPath + '/extjs/incentivos/GestionIncentivoUsuarioAccion.do'
});//stIncentivosUsr

Condor
3 Sep 2010, 1:46 AM
The grid has an 'afteredit' event and the store has an 'update' event.

occiso
3 Sep 2010, 2:04 AM
the error was I didn't put the event into listener{}

Condor
3 Sep 2010, 2:35 AM
the error was I didn't put the event into listener{}

Which we could have spotted a lot easier if you would have posted your code in [CODE] tags instead [QUOTE] tags!