You found a bug! We've classified it as EXTJS-14010 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    May 2014
    Posts
    21
    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
    274
    Vote Rating
    77
    Phil Guerrant is just really nice Phil Guerrant is just really nice Phil Guerrant is just really nice Phil Guerrant is just really nice

      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
    16,645
    Vote Rating
    583
    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
    16,645
    Vote Rating
    583
    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, Goias, Goiânia
    Posts
    394
    Vote Rating
    4
    wemerson.januario is on a distinguished road

      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
    Skype:
    wemerson.januario
    Email: wemerson.januario@gmail.com
    Fone:
    62 84101145 - Goiânia-GO- Brazil
    Consulting and Training Ext JS
    Projects: (Nubes ERP)

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,645
    Vote Rating
    583
    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, Goias, Goiânia
    Posts
    394
    Vote Rating
    4
    wemerson.januario is on a distinguished road

      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
    Skype:
    wemerson.januario
    Email: wemerson.januario@gmail.com
    Fone:
    62 84101145 - Goiânia-GO- Brazil
    Consulting and Training Ext JS
    Projects: (Nubes ERP)

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,645
    Vote Rating
    583
    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, Goias, Goiânia
    Posts
    394
    Vote Rating
    4
    wemerson.januario is on a distinguished road

      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
    Skype:
    wemerson.januario
    Email: wemerson.januario@gmail.com
    Fone:
    62 84101145 - Goiânia-GO- Brazil
    Consulting and Training Ext JS
    Projects: (Nubes ERP)