Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-8281 in a recent build.
  1. #1
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,743
    Vote Rating
    104
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default [4.2.0.265] TreeStore CRUD broken

    [4.2.0.265] TreeStore CRUD broken


    This was broken back in 4.0.x, new regression in 4.2.0. 'internalId' is not set on a newly created Record. This breaks nodeHash when removing a record later.

    Code:
    Ext.onReady(function() {
        Ext.define('Task', {
            extend: 'Ext.data.Model',
            idProperty : 'Id',
            fields: [
                {name: 'Id' },
                {name: 'task',     type: 'string'},
                {name: 'user',     type: 'string'},
                {name: 'duration', type: 'string'},
                {name: 'done',     type: 'boolean'}
            ]
        });
    
        var store = Ext.create('Ext.data.TreeStore', {
            model: 'Task',
            proxy: {
                type: 'ajax',
                //the store will get the content from the .json file
                api: {
                    create : 'treecreate.json'
                }
            },
            root : {},
            listeners : {
                write : function() {
                      console.log(this.getRootNode().firstChild.internalId) // SHOULD BE 111
                }
            }
        });
    
        store.getRootNode().appendChild(new Task({}));
        store.sync();
    });
    Server responds:
    Code:
    [{
        task:'Project: Shopping',
        Id : 111,
        user:'Tommy Maintz',
        iconCls:'task-folder'
    }]

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,824
    Vote Rating
    836
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


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

Thread Participants: 1