PDA

View Full Version : Sencha Standalone ScriptTag



lukemc
23 Sep 2011, 6:20 AM
Was having some cross-domain jsonp headaches and came across this (http://www.sencha.com/forum/showthread.php?6823-Ext.form-load-from-cross-domain&p=652269) old thread.

I was also looking for a standalone (not connected to a store) example like gkassyou in that post and am confused by gkassyou's post asking for one, and then immediately after Animal's post saying he has the TreeLoader code, did I miss something?

I'm looking to implement it inside a Sencha app.

L

eyepoker
23 Sep 2011, 6:46 AM
Something like this? you can update a panel using its update method, no store needed. Or, you can do whatever you like with the returned data........




function getSomeJSONP(){
Ext.util.JSONP.request({
url: 'your jsonp service url here',
callbackKey: 'callback', // no need to change this
params: {
someParam1:'value', // whatever you need to be passing... usually a login or session key...
someParam2:'value'
},
callback: function(data) {
if (!data){
Ext.Msg.alert('Failed to get data');
} else {
// do whatever you like with the returned data object
yourResultPanel.update(data); // if your panel has a template, this will update it
}
}
});// end JSONP request
}