1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    34
    Vote Rating
    0
    samir_ware is on a distinguished road

      0  

    Default How to get hold over JSON object while using HTTPProxy?

    How to get hold over JSON object while using HTTPProxy?


    Hello all
    I have created a JSON grid which uses HTTP proxy for fetching data from server.Though is there any way by which I can get hold over the entire JSON object ?
    Any white paper /link will greatly be appreciated.
    Thanks
    Samir

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    Not sure I understand your question?

    If you are already able to make AJAX requests and receive data from the server, then surely you already have access to the full JSON object in the AJAX response (which you then load into the grid)?

    http://docs.sencha.com/ext-js/3-4/#!...method-request

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    34
    Vote Rating
    0
    samir_ware is on a distinguished road

      0  

    Default


    Thanks for the reply willigogs
    I am loading the grid there by using store.load() method. I have configured the http proxy for the grid which does the task of sending request to the server for the data. Thats the reason I don't have access to the whole JSON object from server.
    Is there any way to have control over this JSON object ?
    Thanks
    Samir

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    Ah ok, that makes sense

    I guess it depends when exactly you need the full JSON object, as you should be able to grab it at any point after the store has been loaded from store.reader.jsonobject (not at my computer so that path might not be 100% accurate, but it's definitely under the reader).

    If you need the JSON object BEFORE it is loaded into the store, then I believe you would have to replace your store.load() method with a manual AJAX call. This will allow you to grab the response and handle it however required.

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    34
    Vote Rating
    0
    samir_ware is on a distinguished road

      0  

    Default


    Ahh....thats kool.
    You are absolutely right about the reader. I did grab the JSON from reader. Though I was thinking there might be some sophisticated API or event to achieve this. If its not there then reader.data is the perfect solution for me to move on.
    Thanks
    Samir

Thread Participants: 1