PDA

View Full Version : Take part button by id



jbdiacompleto
16 Feb 2011, 3:32 AM
Hello everybody ..

I'm trying to get a button by reference in accordance with the example below, but it gives error that was not found my button.




Painel_UsuariosListagem = Ext.extend(Painel_UsuariosListagemUi, {
initComponent: function() {
Painel_UsuariosListagem.superclass.initComponent.call(this);
//Ext.getCmp('Button_UsuariosListagemPesquisar').on('click', this.btnCancelar, this);
this.botaoTeste.on("click", this.btnCancelar, this);
},


btnCancelar: function(){

alert("");

}


Now appreciate the help

jbdiacompleto
16 Feb 2011, 5:05 AM
Managed to do, in fact I had to point the level it was in my references, but what happens now is that the click event does not work, he does not give the message alert function that I put in ...

could someone help me?

steffenk
16 Feb 2011, 5:33 AM
did you configured btnCancelar with ref? Then it should work.

jbdiacompleto
16 Feb 2011, 5:41 AM
So he is taking the ref and the reference but is not running click ... and apparently the code is correct, see:



Painel_UsuariosListagem = Ext.extend(Painel_UsuariosListagemUi, {
initComponent: function() {
Painel_UsuariosListagem.superclass.initComponent.call(this);
//Ext.getCmp('Button_UsuariosListagemPesquisar').on('click', this.btnCancelar, this);
this.botaoTeste.on('click', this.btnCancelar, this);

},

btnCancelar: function(){

Ext.Msg.alert("AHd");

}

}


I await help ...:)