1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default json-p through store

    json-p through store


    • I get this error when i try to create a store that does a json-p request
    • Uncaught Error: The 'jsonp' type has not been registered with this manager

    var store = new Ext.data.Store ({
    autoLoad: true,
    method:'GET',
    model: "User",
    params: {
    synID:300068,
    room:0,
    year:2011,
    term:4,
    day:2,
    callType:'student'
    },
    proxy: {
    type: 'jsonp',
    url : 'https://intranet.trinity.vic.edu.au/timetable/getTimetable.asp',
    reader: {
    type: 'json',
    root: 'users'
    }
    }
    });


    var localUser = new Ext.data.Store({
    model: 'timetable',
    proxy: {
    type: 'localstorage',
    id : 'localUser',
    proxy: {
    idProperty: 'id'
    }
    }
    });

  2. #2
    Ext JS Premium Member
    Join Date
    Jul 2009
    Posts
    1
    Vote Rating
    0
    ralberts is on a distinguished road

      0  

    Default Same Issue

    Same Issue


    I am having the same issue at the moment. Did you figure out what you did wrong?

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default Ralberts

    Ralberts


    Hi

    i did not fix the problem as such i just created a php file that responded with a callback. Json-P needs this callback as it is JSON wrapped in Javascript. You could try ajax through phonegap. as there is no problems with cross domain when you use the file:// system. i will be writing an article about that in the coming weeks and will post the url when it is done

    matt

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default


    to amend my last post just use the word scripttag instead of json-p

  5. #5
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    San Antonio, TX
    Posts
    93
    Vote Rating
    0
    jnotti is on a distinguished road

      0  

    Default


    If you change your proxy to scripttag like it is mentioned above, your JSONP requests will automatically be handled.

    Code:
    proxy: {
            type: 'scripttag',
            url : 'https://intranet.trinity.vic.edu.au/timetable/getTimetable.asp',
            reader: {
                root: 'users'
            }
        }

Thread Participants: 2