Results 1 to 5 of 5

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

  1. #1
    Sencha User
    Join Date
    Feb 2010
    Location
    Figueres (Spain)
    Posts
    368
    Answers
    15
    Vote Rating
    5
      0  

    Default 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 Juarez

  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 User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    114
      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
    Location
    Figueres (Spain)
    Posts
    368
    Answers
    15
    Vote Rating
    5
      0  

    Default

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

  5. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    114
      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
    Location
    Figueres (Spain)
    Posts
    368
    Answers
    15
    Vote Rating
    5
      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 Juarez

Posting Permissions

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