Ext.ux.JSONP for ExtJS 4
Here is a solution for making simple JSONP requests in ExtJS 4
Ext.define('Ext.ux.JSONP', {
extend: 'Ext.data.ScriptTagProxy',
alias: 'ux.jsonp',
createRequestCallback: function(request, operation, callback, scope) {
var me = this;
return function(response) {
callback.apply(scope, [response]);
operation.setCompleted();
operation.setSuccessful();
me.afterRequest(request, true);
};
}
});