我有这段代码:
{
xtype: 'gridcolumn',
dataIndex: 'parentesco',
itemId: 'parentesco',
flex: 1,
text: 'Parentesco',
editor: {
xtype: 'combobox',
name: 'parientes',
valueField: 'codigo',
displayField: 'descripcion',
store: Ext.create('SgaWeb.store.administrativo.rrhh.dominio.Parentesco', {autoLoad:false}),
allowBlank : false,
editable: false,
//readOnly: true,
itemId: 'parientes',
listeners: {
beforeselect: function()
{
var me = this;
SgaWeb.app.getController('SgaWeb.controller.administrativo.rrhh.GestionRecursosHumanos').grid();
//var gridGrupoFamiliar = me.ventanaGestionRrhh.down('#pestanasVarias').down('#pestanaGrupoFamiliar');
var fila = grid.getSelectionModel().getSelection()[0];
var codigo = fila.get('codigo');
alert(+codigo);
},
select: function(combo){
var id = combo.getValue();
var record = combo.getStore().getById(id);
record = combo.findRecord(combo.valueField || combo.displayField, id);
me.down('#parentesco').getEditor().setValue(record.get('codigo'));
var fila = me.getSelectionModel().getSelection()[0];
fila.set('parentesco',record.get('codigo'));
},
}
}
},
在beforeselect:function中,我试图在组合框选择之前调用控制器中的函数。
有没有办法做到这一点?