PDA

View Full Version : How can call methode from controller



j4meson
12 Jul 2012, 4:56 AM
hi all, i can access to my function 'showme'
'this' corresponding at store,so i doesn't work, how catch this function, how call this controller function


init: function () {
this.control({
'panelCenter': {
render: function (panel) { this.getUsersStore().on('load', function () { this.showme});}
}
}) },
showme: function () {
alert('i am in')
}


thanks a lot for your help

sword-it
12 Jul 2012, 6:06 AM
Hi J4meson,

Try this code-



init:function(){
this.control:({
'panelCenter' : {

render: function (panel) { this.getUsersStore().on('load', function () {
this.showme
}, this ); // this is third argument for keep scope

}
});
}
, showMe : function(){
alert('i am in');
}


For more Info see http://www.sencha.com/forum/showthread.php?229941-How-can-call-methode-from-controller&p=853249#post853249

j4meson
13 Jul 2012, 2:17 AM
Thanks a lot "sword-it" it works ;)