Results 1 to 3 of 3

Thread: Get raw server response after store sync()

  1. #1
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    33
    Answers
    3

    Default Answered: Get raw server response after store sync()

    I'm not using the Direct package in my app and have been Ok up until now with processing side-band info in my server response using the data provided by the Ext.Ajax request callbacks as they provide that info in the event handler arguments.

    I can't figure out at the moment is how to see the full server response after a store sync operation.

    I'm using this:

    Code:
    myStore.sync({
      callback: function(batch, options) {
        // How to find the raw server response?
      }
    );
    I couldn't see the response anywhere in the batch object - am I just missing it or can I find it somewhere else?

    Perhaps I need to handle this side-band info differently? I looked at the store/reader metaData change event but couldn't figure out how to really set that up to fire - perhaps there is an example that I can't find right now?

    Appreciate any help on this.
    Thanks,
    Neil

  2. Hi,
    The best option is to listen to the 'write' event which will capture all Create, Update, and Delete actions. The 'load' event will capture all Read actions.
    From there you'll have access to the store and can get to the raw data via:

    Code:
    store.getProxy().getReader().rawData;

  3. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    Hi,
    The best option is to listen to the 'write' event which will capture all Create, Update, and Delete actions. The 'load' event will capture all Read actions.
    From there you'll have access to the store and can get to the raw data via:

    Code:
    store.getProxy().getReader().rawData;

  4. #3
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    33
    Answers
    3

    Default

    Ah - that looks promising.I did get to try the metadata change event on the reader proxy too and that seems to be working - though I had to replicate the response success/status in the metaData at the server so I will see if this approach can help reduce that.Thanks,Neil

Posting Permissions

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