store sync with rest proxy batch operation

  1. #1

    store sync with rest proxy batch operation

    Code bellow represent store configured to use rest proxy.Everything works just fine when store has one dirty record.When store has multiple records to be updated it does not send them as batch. I have tried many options of JsonWriter properties but with no luck.Is RestProxy designed only for one Record???
     <ext:Store runat="server" AutoSync ="false"  ID ="storeCrud"   >
                                <Proxy>
                                    <ext:RestProxy Url="~/api/crud/getData" >
                                         <Reader>
                                            <ext:JsonReader Root="data" TotalProperty="total"></ext:JsonReader>
                                        </Reader>
                                        <Writer>
                                            <ext:JsonWriter   WriteAllFields ="true"/>
                                        </Writer>
                                        <Headers>
                                            <ext:Parameter Name="Accept" Value="application/json"></ext:Parameter>
                                        </Headers>
                                        <API Update="~/api/crud/saveData"></API>
                                        <API Create ="~/api/crud/createData"></API>
                                        
                                    </ext:RestProxy>
                                </Proxy>
                                <Model>
                                    <ext:Model runat="server">
                                        <Fields>
                                            <ext:ModelField Name="companyId" Type="Int" />
                                            <ext:ModelField Name="company" />
                                            <ext:ModelField Name="price" Type="Float" />
                                            <ext:ModelField Name="change" Type="Float" />
                                            <ext:ModelField Name="pctChange" Type="Float" />
                                            <ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                                        </Fields>
                                    </ext:Model>
    
                                </Model>
                                
                                <Listeners>
                                   <BeforeSync Handler ="console.log('before sync')" ></BeforeSync>
                                   <Write Handler ="console.log('complete')"></Write>
                                </Listeners>
                            </ext:Store>
                        </Store>
  2. #2

    Rest Proxy BatchAction Property

    There is a property to be set on RestProxy
    <ext:RestProxy Url="~/api/crud/getData" BatchActions ="true"  >

Similar Threads

  1. Replies: 3
    Last Post: May 06, 2013, 12:52 PM
  2. Store batch order
    By Pulkownik in forum 2.x Help
    Replies: 2
    Last Post: Mar 04, 2013, 11:59 AM
  3. [CLOSED] REST store sync callback
    By thesvr in forum 2.x Premium Help
    Replies: 7
    Last Post: Nov 08, 2012, 1:57 PM
  4. [CLOSED] Rest proxy load and autoload
    By Akpenob in forum 2.x Premium Help
    Replies: 6
    Last Post: Nov 06, 2012, 9:08 AM
  5. [CLOSED] [1.0] Store and REST
    By Timothy in forum 1.x Premium Help
    Replies: 8
    Last Post: Feb 28, 2010, 5:19 AM

Posting Permissions