[CLOSED] EventStore and REST API

  1. #1

    [CLOSED] EventStore and REST API

    I was trying to use the event store using the REST API, but it's not working. For some reason, the store is only sending Creates and not Updates. I was wondering if you knew why or what I have to do in order to get it to post an update.

    Have you guys overrided this in your EventStore implementation?

    Also, why can't i add a writer?

    <EventStore ID="storeCalendarEvents" runat="server" DateFormat="yyyy-MM-ddThh:mm:ss" Restful="true">
                            <Proxy>
                                <ext:HttpProxy>
                                    <RestAPI
                                         CreateUrl = "/Event/Create"
                                         UpdateUrl = "/Event/Update"
                                         DestroyUrl = "/Event/Delete"
                                         ReadUrl = "/Event/GetEventsByDate" />
                                </ext:HttpProxy>
                            </Proxy>
                            <Reader>
                                <ext:JsonReader Root="data">
                                   <Fields>
                                        <ext:RecordField Name="EventId" />
                                        <ext:RecordField Name="CalendarId" />
                                        <ext:RecordField Name="Title" />
                                        <ext:RecordField Name="StartDate" Type="Date" />
                                        <ext:RecordField Name="EndDate" Type="Date" />
                                        <ext:RecordField Name="IsAllDay" />
                                        <ext:RecordField Name="Location" />
                                        <ext:RecordField Name="Notes" />
                                        <ext:RecordField Name="Url" />
                                        <ext:RecordField Name="Reminder" />
                                        <ext:RecordField Name="IsNew" />
                                        <ext:RecordField Name="InviteCode" />
                                        <ext:RecordField Name="UserResponse" />
                                        <ext:RecordField Name="ClassName" />
                                    </Fields>
                                </ext:JsonReader>
                            </Reader>
                        </EventStore>
    Here's the save logic
    save: function (rec) {
             frmPlnCalendarEditEvent.getForm().updateRecord(rec);
             if(MyCalendar.record.isNew) {
                    MyCalendar.getStore().add(rec);
              } 
             MyCalendar.changeCustomView("calendar");
             MyCalendar.getStore().save(); // should trigger events -- currently only triggers the create 
    }
    Last edited by Daniil; Mar 04, 2011 at 3:32 PM. Reason: [CLOSED]
  2. #2
    Hi,

    What response do you build for Create request?
    Response must contains success flag and values from server
    Like
    {success:true,message:"Created new Person",data:{"Email":"e@e.r","First":"1","Last":"2","Id":8}}
    If you response is incorrect then your event will be phantom and Update operation will not be perfromed

    Please investigate the following sample
    https://examples1.ext.net/#/GridPanel/Restful/Overview/
  3. #3
    The CREATE currently fails because it's not implemented yet on the server side.

    However, even when using pre-exisiting Events and modifying them, the UPDATE is never sent.
  4. #4
    Hi,

    You have to specify IDProperty in the reader
    IDProperty="EventId"
  5. #5
    wow, great call!!!

Similar Threads

  1. [CLOSED] Rest api.
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Aug 19, 2011, 11:22 AM
  2. [CLOSED] REST with WCF - part 2
    By daneel in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 14, 2011, 2:40 PM
  3. [CLOSED] REST with WCF and Ext.NET 1.0
    By daneel in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 11, 2011, 10:34 AM
  4. [CLOSED] [1.0] Store and REST
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Feb 28, 2010, 4:19 AM
  5. [CLOSED] [1.0] REST question
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Nov 30, 2009, 12:48 PM

Posting Permissions