Results 1 to 6 of 6

Thread: Why does the 4.2 Rest Proxy include id of 0 in buildUrl ?

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    138
    Vote Rating
    4
      0  

    Default Why does the 4.2 Rest Proxy include id of 0 in buildUrl ?

    4.2 made a change in Ext.data.proxy.Rest to include id 0 in buildUrl (see isValidId). Why was this change made? As a phantom record has id 0, then a record.save() will post with a url ending in '/0'. I don't think that is the normal REST convention, but rather the id should no go on the end. Does someone have more info on why this was changed in such a way?

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    89
      2  

    Default

    Don't know why it was changed, but per a note on the buildURL() method in the Rest proxy docs, you can set useNull : true on your Model's ID property to prevent this from happening.

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    138
    Vote Rating
    4
      0  

    Default

    that works great. thanks a lot.

  4. #4
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    89
      0  

    Default

    Sure thing. I actually just ran across the same thing last night, so I was glad that @psheldon pointed out the fix

  5. #5
    Sencha User
    Join Date
    Apr 2011
    Posts
    29
    Vote Rating
    1
      0  

    Default

    It's been a discussion since a while, but I believe ExtJS doesn't handle building the url in a correct manner. That's why I proposed a fix and posted it in this other thread http://www.sencha.com/forum/showthre...10#post1029610

  6. #6
    Sencha User
    Join Date
    Feb 2014
    Posts
    1
    Vote Rating
    0
      0  

    Default

    thanksss

Posting Permissions

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