Results 1 to 4 of 4

Thread: [beta2] Loading list's store the second time -> list is empty

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2011
    Posts
    29
    Vote Rating
    0
      0  

    Default [beta2] Loading list's store the second time -> list is empty

    Hi,

    I have a simple list of objects. On that itemtap event I display another list in a modal dialog and load related items via the store. The first time works, but on the second try the list display its empty text.

    Code:
    onParteiListTap: function(dataview, index, target, record, e, options) {
    
    var store = Ext.getStore('BewerberStore'),
        tap_record = record;
    
    
    if(this.overlay) {
        Ext.Viewport.remove(this.overlay, true);
        this.overlay = null;
    }
    
    
    store.load();
    
    
    store.filterBy(function(record, id) {
        // he finds results every time
        return record.get('partei_id') == tap_record.get('id');
    });
    
    
    this.overlay = Ext.Viewport.add({
        xtype: 'panel',  modal: true,
        centered: true,  width: 300,
        height: 450,     layout: 'fit',
        styleHtmlContent: true,
    
    
        items: [
        {
            docked: 'top',
            xtype: 'toolbar',
            title: 'Bewerber ' + tap_record.get('name')
        },
        {
            xtype: 'list',
            emptyText: 'Nothing in here',
            itemTpl: [
            '<div><div class="bewerber_name">{name}</div>'+
            '<div class="bewerber_stimmen">{stimmen} Stimmen</div></div>'
            ],
            store: store
        }
        ],
        scrollable: true
    });
    
    
    this.overlay.show('pop');
    
    }
    This doesn't even work when I tap on the same list item as before.
    Attached Images Attached Images
    Last edited by mitchellsimoens; 10 Feb 2012 at 6:09 AM. Reason: formatting

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

    Default

    Just as a test, what happens when you take out the filterBy?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Ext GWT Premium Member
    Join Date
    Oct 2011
    Posts
    29
    Vote Rating
    0
      0  

    Default

    Interesting... Without the filterBy or with always returning true it works.
    But I don't think my expression is the problem, because when I console.log it, I will get some false and some true results. So some objects should be displayed.

  4. #4
    Ext GWT Premium Member
    Join Date
    Oct 2011
    Posts
    29
    Vote Rating
    0
      0  

    Default

    The filters need to be cleared before redefining.

    Code:
    store.clearFilter();

Tags for this Thread

Posting Permissions

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