siebmanb
30 Aug 2011, 10:02 AM
Hello everyone,
This is my first post, I hope I am posting in the right place.
I placed [...] to hide useless code and private data.
I have this sample code :
Ext.regController('Page', {
[...]
getData: function(){
Ext.util.JSONP.request({
url: 'http://[...]/index.php',
callbackKey: 'callback',
params: {
action: 'getInfo',
},
callback: function(data) {
this.refresh(data);
},
});
},
refresh: function(data)
{
alert(data);
},
});
I would like to call the "refresh" function from the callback of the JSONP request in the "getData" function. In other words, I would like the data to pop up when I call getData.
Is that even possible ?
PS : my actual problem is interacting with the View attached to the Controller. It is possible from "refresh" for example but not from the callback function.
Thanks a lot
This is my first post, I hope I am posting in the right place.
I placed [...] to hide useless code and private data.
I have this sample code :
Ext.regController('Page', {
[...]
getData: function(){
Ext.util.JSONP.request({
url: 'http://[...]/index.php',
callbackKey: 'callback',
params: {
action: 'getInfo',
},
callback: function(data) {
this.refresh(data);
},
});
},
refresh: function(data)
{
alert(data);
},
});
I would like to call the "refresh" function from the callback of the JSONP request in the "getData" function. In other words, I would like the data to pop up when I call getData.
Is that even possible ?
PS : my actual problem is interacting with the View attached to the Controller. It is possible from "refresh" for example but not from the callback function.
Thanks a lot