Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1564 in a recent build.
  1. #1
    Touch Premium Member
    Join Date
    Jan 2012
    Location
    Los Angeles, CA
    Posts
    32
    Vote Rating
    1
    melevine is on a distinguished road

      0  

    Default List: cannot clear selection in store 'load' listener

    List: cannot clear selection in store 'load' listener


    Ext version tested:
    • Sencha Touch 2.0PR3
    Browser versions tested against:
    • Chrome 11 (Linux)
    Description:
    • Ext.dataview.List - cannot clear selection in store's load listener
    Steps to reproduce the problem:
    • Create an Ext.dataview.List with a simple store, add a listener to the store's load event and change the selection in the load event
    The result that was expected:
    • The previous selection should clear and the new selection should be set
    The result that occurs instead:
    • The previous selection is maintained in the view but calling list.getSelected().items returns the correct information. So whats on the webpage has more selected items than in the actual js object

    Here's how I reproduce it, load some initial data into the store, select something, update the data in the store, and nothing gets deselected. The weird thing is before updating the store, view.getSelected().items has my selection, after updating the store its empty, but the view still shows a selection on the page.

    Code:
    Ext.define('app.view.MyList', {
         extend : 'Ext.dataview.List',
         selindex : 0,
         constructor : function(config) {
            this.callParent(arguments);
            var store = this.getStore();
            store.addListener('load', this.onStoreLoad, this);
            store.load();
        },
    
        config: {
            disclosure : true,
            itemTpl : '<strong>{foo}</strong><br><small>{bar}</small>',
        },
    
        onStoreLoad : function(store, records, successful) {
             this.selindex = this.selindex + 1;
             this.select(this.selindex, false);
       }
    });

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    Thanks for the detailed report.

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    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


    Have you tried this in PR4? It seems to work as expected there.

    Sencha Inc

    Jamie Avins

    @jamieavins

  4. #4
    Touch Premium Member
    Join Date
    Jan 2012
    Location
    Los Angeles, CA
    Posts
    32
    Vote Rating
    1
    melevine is on a distinguished road

      0  

    Default


    Yup, seems to be working in PR4

Thread Participants: 2