1. #1
    Sencha User TopKatz's Avatar
    Join Date
    Mar 2007
    Posts
    337
    Vote Rating
    1
    TopKatz is on a distinguished road

      0  

    Default Writer insert sends array or object

    Writer insert sends array or object


    Im using a store with a writer with some success. I however ran into an issue when I have the store handle both single and batch inserts.

    When I have the store insert a single item, data goes out as a single object. When I insert a batch, it goes out as an array of objects in data. Is there a way to tell the writer to always send out an array of objects, even if its just one?

    Having to handle both on the back end is a little ugly.

    Katz

    EDIT - listful:true in the writer config does the trick. RTFM!!!!

  2. #2
    Touch Premium Member
    Join Date
    Aug 2010
    Location
    New York, NY
    Posts
    66
    Vote Rating
    0
    sandeep45 is on a distinguished road

      0  

    Question store always sends data out as an array

    store always sends data out as an array


    i have a store associated with a model. when i create a new record of that model type and add it to the store and then do sync() on the store, it then sends the json with the data in an array. the request looks like this:
    {"notes":[{"body":"dsfs","id":""}]}
    how can i make it as an object not as an array. i would like it to look like:
    {"note":{"body":"dsfs","id":""}}

Thread Participants: 1