Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-14010 in 5.0.2.
  1. #1
    Sencha User
    Join Date
    May 2014
    Posts
    28
    Vote Rating
    0
    romainpicxi is on a distinguished road

      0  

    Default Erase a record from his model with an auto synchronized store

    Erase a record from his model with an auto synchronized store


    I want to remove a record with the model's erase method. When my store has autoSync=true the erase request is sent two time.
    When I remove autoSync, it works fine.

    Romain

  2. #2
    Sencha - Ext JS Dev Team Phil Guerrant's Avatar
    Join Date
    May 2011
    Location
    Colorado
    Posts
    336
    Vote Rating
    93
    Phil Guerrant is a glorious beacon of light Phil Guerrant is a glorious beacon of light Phil Guerrant is a glorious beacon of light Phil Guerrant is a glorious beacon of light Phil Guerrant is a glorious beacon of light

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,150
    Vote Rating
    673
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Can you elaborate a bit more on what you're trying to do? The call to erase essentially does:

    Code:
    this.drop();
    this.save();
    So it causes the ajax request to happen immediately. Are you looking to have the request just on a single record and not trigger a sync? Or you just want to call a method on the model as opposed to remove it from the store?

    If it's the latter, calling drop() may be more appropriate.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,150
    Vote Rating
    673
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Can you comment on what I posted above. What is your intent here?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goiânia
    Posts
    472
    Vote Rating
    12
    wemerson.januario will become famous soon enough

      0  

    Default


    Quote Originally Posted by evant View Post
    Can you elaborate a bit more on what you're trying to do? The call to erase essentially does:

    Code:
    this.drop();
    this.save();
    So it causes the ajax request to happen immediately. Are you looking to have the request just on a single record and not trigger a sync? Or you just want to call a method on the model as opposed to remove it from the store?

    If it's the latter, calling drop() may be more appropriate.

    I also have this same problem with autoSync stores.

    In my app I've replaced myRecord.destroy() to erase and now I have two ajax requests.


    I Hope you can fix it next release!

    Thanks!
    Wemerson Januario
    Twitter:
    @januariocoder
    Email: wemerson.januario@gmail.com

    From: Goiânia, Brazil
    Ext JS Developer

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,150
    Vote Rating
    673
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    If the store is autoSync, why are you calling erase? Why not drop, then let the store handle it?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goiânia
    Posts
    472
    Vote Rating
    12
    wemerson.januario will become famous soon enough

      0  

    Default


    Quote Originally Posted by evant View Post
    If the store is autoSync, why are you calling erase? Why not drop, then let the store handle it?
    because erase I can pass options like success and failure and drop I can't! I would like to keep using like old destroy method!
    Wemerson Januario
    Twitter:
    @januariocoder
    Email: wemerson.januario@gmail.com

    From: Goiânia, Brazil
    Ext JS Developer

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,150
    Vote Rating
    673
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Ok, but then why are you using autoSync on the store?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  9. #9
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goiânia
    Posts
    472
    Vote Rating
    12
    wemerson.januario will become famous soon enough

      0  

    Default


    Quote Originally Posted by evant View Post
    Ok, but then why are you using autoSync on the store?
    Hi @Evant! Because sometimes I use autoSync for cellEditing and RowEditing plugin,
    Wemerson Januario
    Twitter:
    @januariocoder
    Email: wemerson.januario@gmail.com

    From: Goiânia, Brazil
    Ext JS Developer

  10. #10
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goiânia
    Posts
    472
    Vote Rating
    12
    wemerson.januario will become famous soon enough

      0  

    Default


    is this bug fized EXTJS-14010 ?
    Wemerson Januario
    Twitter:
    @januariocoder
    Email: wemerson.januario@gmail.com

    From: Goiânia, Brazil
    Ext JS Developer