1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    356
    Answers
    15
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default Answered: How to return server response on sync batchmode multiple records operations

    Answered: How to return server response on sync batchmode multiple records operations


    Can anyone explain (with example if possible) what response structure i have to return from php to client side if i want to receive all refreshed data to propagate new ids records, and to obtain each error message from each record that i have sended with sync ?
    -------------------
    Manel Juàrez

  2. 1. For creating/updating requests, you should return something like this:
    Code:
    {
        "success": true/false, 
        "data": [...] // an array of updated or newly created records with ids
    }
    2. For deleting requests, you should return {"success": true} or {"success": false}

  3. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      1  

    Default


    1. For creating/updating requests, you should return something like this:
    Code:
    {
        "success": true/false, 
        "data": [...] // an array of updated or newly created records with ids
    }
    2. For deleting requests, you should return {"success": true} or {"success": false}

  4. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    356
    Answers
    15
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    thanks vietits, and for return one error message or correct message for each record ?
    -------------------
    Manel Juàrez

  5. #4
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    What I mentioned is for returning response for each request. It tells that request is successful or not but it does not tell which record is successful and which record is error. Maybe you should include this information in each returned record and handle it by yourself.

  6. #5
    Sencha User
    Join Date
    Feb 2010
    Posts
    356
    Answers
    15
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    tome someone who could interest.
    See also this link to an approach of commit records with succes: false return value in sync() method

    http://www.sencha.com/forum/showthre...e-record-fails
    -------------------
    Manel Juàrez

Thread Participants: 1