You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2009
    Posts
    13
    Vote Rating
    0
    roady001 is on a distinguished road

      0  

    Default [OPEN-426] List returns wrong records on itemtap after Store.filterBy()

    [OPEN-426] List returns wrong records on itemtap after Store.filterBy()


    List returns wrong records on itemtap after Store.filterBy()

    Code:
    var Proxy = new Ext.data.ScriptTagProxy(
            {
                type: 'ajax',
                url: 'http://<remote_site>/prot.ashx?action=showlist',
                reader: {
                    type: 'json',
                    root: 'data',
                    idProperty: 'protID'
                }
            });
    
    Ext.regModel('protList', {
                fields: [{name: 'protID', type:'integer'}, 
                         {name: 'name', type: 'string'},
                         {name: 'categoryname', type: 'string'}]
            });
    var ListStore = new Ext.data.Store({
                id:'ListStore',
                model: 'protList',
                sorters: 'categoryname',
                getGroupString: function (record) {
                    return record.get('categoryname');
                },
                proxy: Proxy,
                autoLoad: true
            });
    
    var filterFn = function (record, id) {
                if (record.get('name').toLowerCase().indexOf(Ext.getCmp('searchquery').getValue().toLowerCase()) > -1)
                    return true;
            };
    
    var searchBar = [{
                xtype: 'toolbar',
                id: 'searchBar',
                ui: 'light',
                hidden: false,
                dock: 'top',
                items: [{ xtype: 'spacer' }, {
                    xtype: 'textfield',
                    id: 'searchquery',
                    width: '60%',
                    maxWidth: 400,
                    fieldClass: 'searchField',
                    name: 'name',
                    placeHolder: 'Search',
                    showClear: true,
                    listeners: {
                        keyup: function (field, e) {
                            var key = e.browserEvent.keyCode;
                            // blur field when user presses enter/search
                            // which will trigger a change if necessary.
                            if (key === 13) {
                                field.blur();
                            }
                            if (Ext.getCmp('searchquery').getValue() != '')
                            { 
                                Ext.getCmp('clearbutton').setDisabled(false); }
                            else {
                                Ext.getCmp('clearbutton').setDisabled(true);
                            }
                        },
                        blur: function () {
                            ListStore.filterBy(filterFn);
                        }
                    }
                },
                {
                    text: 'Clear',
                    id: 'clearbutton',
                    ui: 'drastic',
                    hidden: false,
                    disabled: true,
                    listeners:
                        {
                            tap: function () {
                                Ext.getCmp('searchquery').setValue();
                                ListStore.clearFilter();
                            }
                        }
                }, { xtype: 'spacer' }
                    ]
            }];
    
    
    // FOLLOWING IS part of tab from tabpanel
    
    items: [{
                        width: Ext.is.Phone || Ext.is.iPad ? undefined : 300,
                        height: 500,
                        id: 'listviewer',
                        xtype: 'list',
                        loadingText: '',
                        store: ListStore,
                        tpl: '<tpl for="."><div class="protlistitem">{name}</div></tpl>',
                        itemSelector: 'div.protlistitem',
                        singleSelect: true,
                        grouped: true,
                        indexBar: false,
                        listeners: { 'itemtap': function (dv, i, el, e) {
                            
                            var protID = dv.store.getAt(i).get('protID');
                            console.log(protID) // Not correct after filtering!
                        }
                        }
                    }]
    After calling the ListStore.filterBy(filterFn) function, the list gets filtered correctly, however tapping on the items (event 'itemtap') in the list returns the wrong record. Well most of them anyway, it seems that only the last records is correct.

  2. #2
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    Thanks for the bug report.

  3. #3
    Sencha User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    gaboo is on a distinguished road

      0  

    Default


    same problem when using grouped list

  4. #4
    Sencha User gcallaghan's Avatar
    Join Date
    Apr 2010
    Location
    Cupertino, Ca
    Posts
    247
    Vote Rating
    0
    gcallaghan is on a distinguished road

      0  

    Default


    My workaround may work for this. see
    http://www.sencha.com/forum/showthre...record-linkage

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    2
    Vote Rating
    0
    michary is on a distinguished road

      0  

    Default


    Any news?

    This is a major bug (it's impossible to use grouped list with an item tap) and open since over a year

  6. #6
    Sencha User
    Join Date
    Jul 2010
    Posts
    8
    Vote Rating
    1
    howellzify is on a distinguished road

      0  

    Default any update on this

    any update on this


    I am running into the same issue. A grouped list returns the wrong index into the store. If the group causes the store to change its sort order the underlying store is not sorted. This leads to the wrong value being retrieved from the store. Any updates on this or ways to get around it? The only thing I can come up with is to pass the XML pre-sorted by the grouped by field.

  7. #7
    Sencha User
    Join Date
    Jul 2010
    Posts
    8
    Vote Rating
    1
    howellzify is on a distinguished road

      0  

    Cool My solution

    My solution


    Quote Originally Posted by howellzify View Post
    I am running into the same issue. A grouped list returns the wrong index into the store. If the group causes the store to change its sort order the underlying store is not sorted. This leads to the wrong value being retrieved from the store. Any updates on this or ways to get around it? The only thing I can come up with is to pass the XML pre-sorted by the grouped by field.
    After looking further I came up with a variation of a solution listed above. This item tap is from a List that is using a grouped store. I use one of the model fields to select the proper index from the store and then retrieve the corresponding record. Works perfectly.

    Code:
    itemtap: function(view, index, item, e){ 
                var el = Ext.get(item);            
                var record = view.store.getAt(view.store.findExact('sermonname',el.select('div.lwflistheader').elements[0].textContent));
                app.view.mediaDetail.update(record.data);
                app.view.mediaDetail.show('pop');
            }

Similar Threads

  1. disclosure and itemtap on list
    By stefx in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 2 Sep 2011, 4:23 AM
  2. getting -1 for index on List itemtap
    By jep in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 30 Sep 2010, 3:24 PM
  3. Replies: 3
    Last Post: 16 Sep 2010, 3:40 AM
  4. [CLOSED-206] Clicking on an empty list fires itemtap
    By meyerovb in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 14 Aug 2010, 5:06 AM
  5. Ext.Store error when servers returns no records
    By mysticav in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 14 Dec 2009, 8:32 AM

Thread Participants: 5

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi