Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Ext.data.proxy.Rest.html and CRUD

  1. #11
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165
    Vote Rating
    79
      0  

    Default

    Another option, and maybe more appropriate for your case, it to use the clientIdProperty config on your Writer. This sends the ID of phantom records under a different key in the request so as to not conflict with what your server may be expecting in the id field.

    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  2. #12
    Sencha User
    Join Date
    Jul 2017
    Posts
    48
    Answers
    2
    Vote Rating
    0
      0  

    Default

    Thanks for your help with this Tristan. It turns out my API was sending back the id encapsulated inside another property ({comment: {id:1}} instead of just {id: 1}) so ExtReact was not able to interpret what id to give to my new object. We were able to get our api to move the id up a level to resolve the issue and now it's working fine. We also were able to remove the id being sent to the server on create, using the transform config and that helped too.

    Thanks for your help with all that!

  3. #13
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165
    Vote Rating
    79
      0  

    Default

    Sounds like it's resolved now, but for future reference, you can configure the Reader to use a different rootProperty. For you, it would be:
    Code:
    proxy: {
        ...
        reader: {
            rootProperty: 'comments'
        }
    }
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: 28 May 2014, 12:25 PM
  2. Replies: 2
    Last Post: 8 Mar 2013, 8:19 AM
  3. Replies: 4
    Last Post: 28 Feb 2013, 8:25 AM
  4. CRUD operation using Rest proxy in ST2
    By senchaSaurav in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 13 Jun 2012, 5:43 PM

Posting Permissions

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