PDA

View Full Version : [2.1.0] JSONP doesn't work in iOS package



tino7_03
21 Nov 2012, 12:35 PM
I have used Ext.data.JsonP in my sencha 2.1.0 app and it works until I use it in browser. I'm using Sencha Architect and after iOS packaging when I try my app on device (or simulator) no data are loaded. I have changed using ajax and my app now works in iOS package also.

mitchellsimoens
21 Nov 2012, 2:59 PM
Are you sure what you are returning is valid JSONP? I have a store that uses jsonp proxy that works.

tino7_03
24 Nov 2012, 12:29 AM
This function works in Chrome and doesn't works in iOS:


getData: function(url,methodName,args,fnSuccessCallback,scope,timeout,waitMsgCmp,fnErrCallback) {


if(timeout===undefined||timeout===null){
timeout=3000;
}
if(waitMsgCmp===undefined||waitMsgCmp===null){
waitMsgCmp=Ext.Viewport.xtype;
}


Ext.ComponentQuery.query(waitMsgCmp)[0].setMasked({ xtype:'loadmask',message: 'Attendere' });
timeout=setTimeout(function(){Ext.ComponentQuery.query(waitMsgCmp)[0].setMasked(false);fnErrCallback();}, timeout);
Ext.data.JsonP.request({
scope:scope,
url: url,
params:{[
methodName: methodName,
args:args,
time: new Date().getTime()
},
callbackKey: 'callback',
callback: function (success,jsonData) {
Ext.ComponentQuery.query(waitMsgCmp)[0].setMasked(false);
clearTimeout(timeout);
fnSuccessCallback(jsonData,this);


}
});
}