1. #11
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    ScriptTagProxy won't work with XML data, it can only process "javascript code", and thus only a JSON object. A ScriptTagProxy is the best cross-browser solution for a cross-domain request at the moment, but you will need to convert your XML object into a JSON object before returning it. If you can do that, then a ScriptTagProxy is the solution - in a JsonStore implementation .js file, add a proxy configuration set to a ScriptTagProxy just below the "storeId" configuration. Hope that helps!

  2. #12
    Sencha User
    Join Date
    Apr 2010
    Posts
    48
    Vote Rating
    0
    whippersnapper is on a distinguished road

      0  

    Default


    Thanks for all the help jarrednicholls...

    I think I'm getting close. I added the ScriptTagProxy within the jsonStore.js file. I see from FF that it's hitting the web-service url with GET and brought back the correct JSON data. But, I still don't see any data populated within the grid when rendering the generated HTML file. Am I missing anything else?

  3. #13
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    The ScriptTagProxy will load a <script> tag onto your page. When the proxy calls your web server, it's passing a parameter named "callback" that you must wrap around your resulting JSON object. For example:

    JSON to return:
    Code:
    [{"id":1,"name":"Test 123"},{"id":2,"name":"Test 456"}]
    This is what you actually return from the web server:
    Code:
    stcCallback123([{"id":1,"name":"Test 123"},{"id":2,"name":"Test 456"}])
    stcCallbackXX is pulled from the "callback" parameter. See the ScriptTagProxy docs for more detail: http://www.extjs.com/deploy/dev/docs...ScriptTagProxy

    I would suggest having your web server do a check for an existing "callback" parameter...if it exists, you wrap your JSON with it...if it doesn't exist, you simply return the JSON verbatim. That way, the same endpoint handler will work with a vanilla JsonStore loading the data within the Designer, as well as your modified JsonStore + ScriptTagProxy in the exported code. Note: the Designer does overwrite your exported Store files, so I recommend creating a second file that inherits your exported Store class and therefore won't continually be overwritten. Perhaps different proxy support will be integrated directly into the Designer in the future.

  4. #14
    Sencha User
    Join Date
    Apr 2010
    Posts
    48
    Vote Rating
    0
    whippersnapper is on a distinguished road

      0  

    Default


    Are you familiar with Presto Mashups? That's what we are using to publish our data (by writing mashups via EMML). I'm not quite sure if their API allows one to manually format the json object. Could I somehow intercept the json object returned and tack on the callback wrapper from the client-side...then pass it to ScriptTagProxy?

Similar Threads

  1. Data binding issue: Cannot load data into editor grid
    By Tumac in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 10 Feb 2010, 9:25 AM
  2. Grid.panel load from Php 'echo' XML no data
    By BobinTN in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 11 Oct 2009, 9:13 PM
  3. [Solved]grid data does not load when grid inside a panel
    By michaelc in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 25 Nov 2008, 4:51 PM
  4. How load data into form panel??
    By beatlecesar in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 15 Jul 2008, 1:05 AM

Thread Participants: 2

Tags for this Thread