Page 1 of 2 12 LastLast
Results 1 to 10 of 16

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
    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
    Location
    France
    Posts
    34
    Vote Rating
    0
      0  

    Default 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
    350
    Vote Rating
    102
      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
    18,383
    Vote Rating
    858
      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 Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goinia - GO, Brazil
    Posts
    634
    Vote Rating
    49
      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
    Site/Blog: http://wemersonjanuario.com.brFrom: Goinia, GO, Brazil
    Consulting Training and Web Development

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,383
    Vote Rating
    858
      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!

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,383
    Vote Rating
    858
      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 Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goinia - GO, Brazil
    Posts
    634
    Vote Rating
    49
      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
    Site/Blog: http://wemersonjanuario.com.brFrom: Goinia, GO, Brazil
    Consulting Training and Web Development

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,383
    Vote Rating
    858
      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 Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goinia - GO, Brazil
    Posts
    634
    Vote Rating
    49
      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
    Site/Blog: http://wemersonjanuario.com.brFrom: Goinia, GO, Brazil
    Consulting Training and Web Development

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

    Default

    is this bug fized EXTJS-14010 ?
    Wemerson Januario
    Site/Blog: http://wemersonjanuario.com.brFrom: Goinia, GO, Brazil
    Consulting Training and Web Development

Page 1 of 2 12 LastLast

Posting Permissions

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