If I have a function that exists in my Viewcontroller that is accessed by several panels within my view, and I want to reference that function from within a XTemplate (tpl), how can I do that?
That would work, but now with a Viewcontroller, I can't figure out how to access a function that lives there, so if I wanted to call to myfunction(test) like in the above example, I can't seem to do it because there doesn't appear to be any equivalent of getController specifically for a Viewcontroller.
In 4.x I could just do something like this:
Code:
tpl: new Ext.XTemplate('Test value: {[this.testVal(values.test)]}', {
testVal: function(test){
var returnme = MyApp.app.getController('main').myfunction(test);
return returnme;
}
});
That would work, but now with a Viewcontroller, I can't figure out how to access a function that lives there, so if I wanted to call to myfunction(test) like in the above example, I can't seem to do it because there doesn't appear to be any equivalent of getController specifically for a Viewcontroller.
Can I even do this? Should I just move this function to the global controller and call it like the above example?
Aucun commentaire:
Enregistrer un commentaire