Results 1 to 2 of 2

Thread: jsonp and Ext.data.ScriptTagProxy problems

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    4
    Vote Rating
    0
      0  

    Default jsonp and Ext.data.ScriptTagProxy problems

    Hi,
    I have been trying to implement jsonp and Ext.data.ScriptTagProxy because I need to retrieve data from another domain, but it seems I am getting an error - Syntax error: invalid label.
    The url I am accessing is this, http://projectlog.gosignmeup.com/por...action=getfeed.
    I have tested the returned json in http://json.parser.online.fr/ and the result is okay.

    Model:
    Ext.define('Actions', {
    extend: 'Ext.data.Model',
    idProperty: 'actionsid',
    fields: [
    { name: 'changelogid', type: 'int' },
    { name: 'friendlyname', type: 'string' },
    { name: 'dateadded', type: 'date' },
    { name: 'changefiles', type: 'string' }
    ]
    });
    Datastore.
    var store = Ext.create('Ext.data.Store',{
    model: 'Actions',
    autoLoad: false,
    autoSync: true,
    pageSize: 5,
    remoteFilter: true,
    remoteGroup: true,
    remoteSort: true,
    proxy: {
    type: 'jsonp',
    url: 'http://projectlog.gosignmeup.com/portal-feed-server.asp?action=getfeed',
    reader: {
    type: 'json',
    root: 'feeds',
    totalProperty: 'totalCount',
    }
    }
    });

    Below is the callback url.
    http://projectlog.gosignmeup.com/por...&limit=5&sort=[{"property"%3A"dateadded"%2C"direction"%3A"desc"}]&callback=Ext.data.JsonP.callback1

    Could this be because there are commas returned in one of the json objects?

    Any help is greatly appreciated.

    Thanks.

  2. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    119
      0  

    Default

    Accessing given url will return a text/html MIME type which is not valid for JsonP proxy. You should see section "Implementing on the server side" from Ext.data.proxy.JsonP API for more information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •