Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2802 in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2009
    Posts
    240
    Vote Rating
    0
    r_honey is on a distinguished road

      0  

    Default [2.0] - Removing a record from store is still returned by DataView's getSelection()

    [2.0] - Removing a record from store is still returned by DataView's getSelection()


    Here's the code to reproduce the issue:

    Code:
    Ext.define('Contact', {
        extend: 'Ext.data.Model',
        config: {
            fields: ['firstName', 'lastName']
        }
    });
    
    
    var store = Ext.create('Ext.data.Store', {
       model: 'Contact',
       sorters: 'lastName',
        
       data: [
           { firstName: 'Tommy',   lastName: 'Maintz'  },
           { firstName: 'Rob',     lastName: 'Dougan'  },
           { firstName: 'Ed',      lastName: 'Spencer' },
           { firstName: 'Jamie',   lastName: 'Avins'   },
           { firstName: 'Aaron',   lastName: 'Conran'  },
           { firstName: 'Dave',    lastName: 'Kaneda'  },
           { firstName: 'Jacky',   lastName: 'Nguyen'  },
           { firstName: 'Abraham', lastName: 'Elias'   },
           { firstName: 'Jay',     lastName: 'Robinson'},
           { firstName: 'Nigel',   lastName: 'White'   },
           { firstName: 'Don',     lastName: 'Griffin' },
           { firstName: 'Nico',    lastName: 'Ferrero' },
           { firstName: 'Nicolas', lastName: 'Belmonte'},
           { firstName: 'Jason',   lastName: 'Johnston'}
       ]
    });
    
    
    Ext.create('Ext.List', {
       fullscreen: true,
       itemTpl: '<div class="contact">{firstName} <strong>{lastName}</strong></div>',
       mode: 'MULTI',    
       store: store
    });
    Click on first 2 items to select them.
    Then execute this code:

    Code:
    var list = Ext.getCmp('ext-list-1'); //Update id if needed
    list.getStore().removeAt(0);
    list.getSelection();
    getSelection() would return 2 records even though the first of them have been removed from the store and DataView's UI too.

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    This has been fixed for the next release. The following override should resolve this issue:

    Code:
    Ext.define('Override.selectable', {
        override: 'Ext.dataview.DataView',
        onSelectionStoreRemove: function(store, records) {
            var me = this,
                selected = me.selected,
                ln = records.length,
                record, i;
    
            if (me.getDisableSelection()) {
                return;
            }
    
            for (i = 0; i < ln; i++) {
                record = records[i];
                if (selected.remove(record)) {
                    if (me.getLastSelected() == record) {
                        me.setLastSelected(null);
                    }
                    if (me.getLastFocused() == record) {
                        me.setLastFocused(null);
                    }
                    me.fireSelectionChange([record]);
                }
            }
        }
    });

    Sencha Inc

    Jamie Avins

    @jamieavins

  4. #4
    Sencha User
    Join Date
    Mar 2009
    Posts
    240
    Vote Rating
    0
    r_honey is on a distinguished road

      0  

    Default


    Great, thanks for sharing the override Jamie!!

  5. #5
    Sencha User
    Join Date
    Mar 2009
    Posts
    240
    Vote Rating
    0
    r_honey is on a distinguished road

      0  

    Default


    Quote Originally Posted by Jamie Avins View Post
    This has been fixed for the next release. The following override should resolve this issue:
    Hi Jamie, I just tried the override and it does not work. Still getting the same issue.

  6. #6
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Might be due to it being a mixin. The 2.0.1 final will have this in place, most likely will be out today.

    Sencha Inc

    Jamie Avins

    @jamieavins

  7. #7
    Sencha User
    Join Date
    Mar 2009
    Posts
    240
    Vote Rating
    0
    r_honey is on a distinguished road

      0  

    Default


    Hi Jamie, this still seems to be an issue in 2.0.1.1
    The same sample code as in the opening post reproduces it. Let me know if I should create a new thread as this has been marked fixed.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar