Results 1 to 2 of 2

Thread: Associated data on record.erase() ?

  1. #1
    Sencha Premium Member siegfriedk's Avatar
    Join Date
    Feb 2010
    Location
    Brazil
    Posts
    21
    Vote Rating
    1
      0  

    Question Associated data on record.erase() ?

    Hello!

    I have two records with a One to Many relationship.
    Ive build a custom proxy to the child records because I need to modify the urls.
    My rest API is something like:
    baseUrl/parent/{PARENTID}/children/{CHILDRENID}

    Code:
    Ext.define('Admin.model.characteristic.ValueProxy', {
        extend: 'Ext.data.proxy.Rest',
        alias: 'proxy.admin.model.characteristic.valueproxy',
        reader: {
            type: 'json',
            rootProperty: 'values'
        },
        buildUrl: function(req) {
            this.setUrl('/characteristics/' + req.getRecords()[0].get("headerId") + '/values');
            return this.callParent([req]);
        }
    
    
    });
    My problem is how to properly get the parent associated record Id from the buildUrl function.
    I managed to find the record from the operation object, but it doesnt look a good solution.
    The other problem is that, on a delete operation, the parentId atribute, the one configured on the model, is null.
    Any ideas??

  2. #2
    Sencha Premium User
    Join Date
    Jan 2014
    Posts
    22
    Answers
    2
    Vote Rating
    2
      0  

    Default

    I am having a similar issue. I also have a custom proxy to accomplish this, but .erase() is causing issues similar to yours.

    See my fiddle below for my implementation, any tips would be appreciated.

    https://fiddle.sencha.com/#fiddle/19p8

Similar Threads

  1. Replies: 7
    Last Post: 4 Jul 2017, 11:33 AM
  2. Undo record.erase removal from store
    By incutonez in forum Ext 5: Q&A
    Replies: 5
    Last Post: 17 Jun 2015, 4:50 PM
  3. Replies: 2
    Last Post: 12 Jun 2015, 4:31 PM
  4. [FIXED] Erase a record from his model with an auto synchronized store
    By romainpicxi in forum Ext 5: Bugs
    Replies: 15
    Last Post: 13 Aug 2014, 9:17 AM
  5. Replies: 0
    Last Post: 27 Jun 2014, 2:35 AM

Posting Permissions

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