Results 1 to 8 of 8

Thread: [2.1] Inconsistent assignment of 'internalId' on models when using store.add()

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3865 in a recent build.
  1. #1
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,015
    Vote Rating
    182
      0  

    Default [2.1] Inconsistent assignment of 'internalId' on models when using store.add()

    When calling add on a store, things go wrong.

    Code:
    Ext.define('M', {
        extend : 'Ext.data.Model',
        config : {
            idProperty : 'foo',
            fields : ['foo']
        }
    });
    
    var store = new Ext.data.Store({ model : 'M', data : [{ foo : 5 }] })
    console.log(store.first().internalId);        // => 5
    store.add([{ foo : 1 }]);
    console.log(store.last().internalId);        // undefined

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Vote Rating
    1297
      0  

    Default

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

  3. #3
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,015
    Vote Rating
    182
      0  

    Default

    Bump, any news on this one? Breaking a few things for us...

    Related thread in our forum http://bryntum.com/forum/viewtopic.p...p=18207#p18207

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    43
    Vote Rating
    1
      0  

    Default Bump

    Any news on this? I'm trying to insert an item to a store after removing an item. It appears to display correctly in a list but when you click an item in the list, it's returning a record w/o accounting for the inserted or removed records.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    43
    Vote Rating
    1
      0  

    Default Work Around

    For a very hackish work around, I ended up creating 2 stores and when I update or remove items from the main store, I do a removeAll() on it and loop through the 2nd store and add it's values to the main store, this seems like the only way to get a fresh internal id for each item.

  6. #6
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,015
    Vote Rating
    182
      0  

    Default

    Bump, any idea when this might get fixed?

  7. #7
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,015
    Vote Rating
    182
      0  

    Default

    Bump bump bump, 3 months...

  8. #8
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    11
      0  

    Default

    Somehow this bug got into the backlog in our system and we have only just dug this one up. This will be fixed in 2.2.1. Sorry for the delay

Posting Permissions

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