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

Thread: Erase a record from his model with an auto synchronized store

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-14010 in 5.0.2.
  1. #11
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    143
    Vote Rating
    21
      0  

    Default

    Quote Originally Posted by wemerson.januario View Post
    is this bug fized EXTJS-14010 ?
    No. Still the same behaviour in 5.0.1. When the application erases a record with model.erase and the model is in an autoSync store it will call the proxy twice.

    As a workaround/solution you could suspend the the autosync of the store temporary.

    Code:
    myStore.suspendAutoSync();
    myModel.erase({
      callback: function(e) {}
    });
    myStore.resumeAutoSync();
    Ralph

  2. #12
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goinia - GO, Brazil
    Posts
    634
    Vote Rating
    48
      0  

    Default

    Quote Originally Posted by ralscha View Post
    No. Still the same behaviour in 5.0.1. When the application erases a record with model.erase and the model is in an autoSync store it will call the proxy twice.

    As a workaround/solution you could suspend the the autosync of the store temporary.

    Code:
    myStore.suspendAutoSync();
    myModel.erase({
      callback: function(e) {}
    });
    myStore.resumeAutoSync();
    Ralph
    Thanks!
    Wemerson Januario
    Site/Blog: http://wemersonjanuario.com.brFrom: Goinia, GO, Brazil
    Consulting Training and Web Development

  3. #13
    Sencha User
    Join Date
    May 2014
    Location
    France
    Posts
    34
    Vote Rating
    0
      0  

    Default

    Thanks

  4. #14
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,367
    Vote Rating
    858
      0  

    Default

    I'm still not really sure on the use case here. Why call erase on the model instance when the store is managing the records? Why not call drop, which will let the store autoSync the delete?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #15
    Sencha User
    Join Date
    May 2014
    Location
    France
    Posts
    34
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by evant View Post
    I'm still not really sure on the use case here. Why call erase on the model instance when the store is managing the records? Why not call drop, which will let the store autoSync the delete?
    I use your solution with drop :-)

  6. #16
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goinia - GO, Brazil
    Posts
    634
    Vote Rating
    48
      0  

    Default

    Quote Originally Posted by evant View Post
    I'm still not really sure on the use case here. Why call erase on the model instance when the store is managing the records? Why not call drop, which will let the store autoSync the delete?
    In my use case, is because I use the callback functions(success, failure) from erase() to do especific rules in my code and drop does not have callback for the droped record.
    Wemerson Januario
    Site/Blog: http://wemersonjanuario.com.brFrom: Goinia, GO, Brazil
    Consulting Training and Web Development

Page 2 of 2 FirstFirst 12

Posting Permissions

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