PDA

View Full Version : How to call the prototype of a public event - inside a listener?



axelaxel
18 Feb 2011, 12:40 AM
hi guys,
i've this editor grid panel, with a listener on the event beforeedit, i would like to manage this event only for some particular scenarios i analyze in the function.
i would like the function's behaviour to be the classical one, the prototype one, if the situation is outside the check scenario.
i need to know how to call the prototype of the base event function, but the red line in the code is not working, the function is not recognized.

(for simplification, i put only the code of the listener of my editor grid panel)



listeners:{
beforeedit: function(event){
//recupero column model
colIndex = event.column;
rowIndex = event.row;

hColumnModel = Ext.getCmp('idGridPanelRisultati').getColumnModel();

if(colIndex != hColumnModel.getIndexById('idFTS_CostoUnitario') && colIndex != hColumnModel.getIndexById('idFTS_Oda')){
hRigaFatturazione = Ext.getCmp('idGridPanelRisultati').getStore().getAt(rowIndex);
console.log(hRigaFatturazione.get('grid_nPlichi'), hRigaFatturazione.get('grid_nPinTotale'), hRigaFatturazione.get('SUC_ID'));

bFatturazioneAttiva = (hRigaFatturazione.get('grid_nPlichi') != '' && hRigaFatturazione.get('grid_nPinTotale') != '') || hRigaFatturazione.get('SUC_ID') > 0 ? true : false;

return bFatturazioneAttiva;
}


return Ext.grid.prototype.beforeedit.call(this, event);
}
},




is there anybody helping me?
thank you in advance


axel

axelaxel
18 Feb 2011, 3:00 AM
The solution is not to return anything.
Without return, the prototype is executed right?