Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7013 in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    marcel.urbanek is on a distinguished road

      0  

    Default Selection disappears when scolling in an infinite grid

    Selection disappears when scolling in an infinite grid


    Hi,
    I have discovered a problem when using selections and the infinite grid mode.

    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.1.1 Build date: 2012-07-04 21:23:42
    Browser versions tested against:
    • Google Chrome 20.0.1132.57 m
    Description:
    • When activating infinite scrolling and selecting a row by mouse click the selection disappears when you scroll the selection far out of the visible area.
    Steps to reproduce the problem:
    • Use infinite scrolling (buffered: true, pageSize: 100) and select a row. When you scroll down and up again the selection isremoved. If you add a selectionchange listener you see that the selection is actually removed from the Selection Model.
    The result that was expected:
    • The selection should not be removed from the Selection Model when scrolling down and should be visible when scrolling back to the selected row again.
    The result that occurs instead:
    • The selection is removed and no longer shown.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,795
    Vote Rating
    834
    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


    Have you tried setting pruneRemoved to false on the selection model?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    marcel.urbanek is on a distinguished road

      0  

    Default


    Hi,

    I am not so sure how to do this. I tried:

    grid.getSelectionModel().setPruneRemoved(false)
    but there is no such method on my SelectionModel. I can not see a property named "pruneRemoved" in the debugger, either.
    However

    grid.getSelectionModel().pruneRemoved=false
    works (of course) but has no effect.

    I found a code snippet that sets the pruneRemoved property when contructing the grid, but the following also seems to have no effect:
    Code:
            
            var grid = Ext.create('Ext.grid.Panel', {                
                    plugins: [cellEditor],
                    width: 100,
                    height: 100,
                    store: store,
                    autoScroll:true,
                    columns:config.columns,
                    renderTo: Ext.get(config.id),
                    selModel: {
                        pruneRemoved: true
                    }
            });

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    46
    Vote Rating
    4
    andrewx is on a distinguished road

      0  

    Default


    Try it like this:

    pruneRemoved: false

    Code:
            var grid = Ext.create('Ext.grid.Panel', {                                 plugins: [cellEditor],                 width: 100,                 height: 100,                 store: store,                 autoScroll:true,                 columns:config.columns,                 renderTo: Ext.get(config.id),                 selModel: {                     pruneRemoved: true                 }         });

  5. #5
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    marcel.urbanek is on a distinguished road

      0  

    Default


    Hi, you are correct: I copied the wrong state of my JavaScript file. But of course I also tried with pruneRemoved:false .
    I just tried "true" to see if it makes any difference - which it doesn't. So both setting don't work: true and false.

  6. #6
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    marcel.urbanek is on a distinguished road

      0  

    Default


    Maybe one interesting information: When I select a row at the top, scroll down, select additionally a row at the bottom and scroll back to the top the selection at the top remains.
    If I select a row at the top scroll down (without selecting additionally a row at the bottom) and scroll up again the selection at the top disappears.

  7. #7
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    marcel.urbanek is on a distinguished road

      0  

    Default


    Hi,

    can I help with additional information? If it is not reproducible for you, I could offer an access to our Showcase Application where this problem occurs.

  8. #8
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    marcel.urbanek is on a distinguished road

      0  

    Default


    Hi,

    the bug can be reproduced in the following example:

    http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/grid/infinite-scroll-with-filter.html

    Select a row at the top, scroll to the bottom and back up to the top: the selection disappears. The example has pruneRemoved: false set.

  9. #9
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    marcel.urbanek is on a distinguished road

      0  

    Default


    Hm, for me the error is pretty good reproducible in the example. Are you still having problems reproducing the problem?
    How can I help?

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,499
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      1  

    Default


    Yes, there's a bug.

    The Record instance that was selected is indeed not being pruned from the SelectionModel's list.

    But when that record get scrolled back into view, the actual Record instance is different, so when it looks it up to re-apply the selection, it's not there.

    It should probably use the id to match the record to be selected.

    Also, if, when refreshing the selection, the record attempting to be re-selected does not exist in the store, it's not replaced back into the selection collection (even though pruneRemoved is false)

    Several bugs here.

    Try these overrides:

    Code:
    Ext.override(Ext.selection.Model, {
        refresh: function() {
            var me = this,
                store = me.store,
                rec,
                toBeSelected = [],
                toBeReAdded = [],
                oldSelections = me.getSelection(),
                len = oldSelections.length,
                selection,
                change,
                i = 0,
                lastFocused = me.getLastFocused();
    
            // Not been bound yet.
            if (!store) {
                return;
            }
    
            // Add currently records to the toBeSelected list if present in the Store
            // If they are not present, and pruneRemoved is false, we must still retain the record
            for (; i < len; i++) {
                selection = oldSelections[i];
                if (store.indexOf(selection) !== -1) {
                    toBeSelected.push(selection);
                }
                
                // Selected records no longer represented in Store must be retained
                else if (!me.pruneRemoved) {
                    // See if a record by the same ID exists. If so, select it
                    rec = store.getById(selection.getId());
                    if (rec) {
                        toBeSelected.push(rec);
                    }
                    // If it does not exist, we have to re-add it to the selection
                    else {
                        toBeReAdded.push(selection)
                    }
                }
            }
    
            // there was a change from the old selected and
            // the new selection
            if (me.selected.getCount() != toBeSelected.length) {
                change = true;
            }
    
            me.clearSelections();
    
            if (store.indexOf(lastFocused) !== -1) {
                // restore the last focus but supress restoring focus
                me.setLastFocused(lastFocused, true);
            }
    
            if (toBeSelected.length) {
                // perform the selection again
                me.doSelect(toBeSelected, false, true);
            }
    
            me.maybeFireSelectionChange(change);
    
            // If some of the selections were not present in the Store, but pruneRemoved is false, we must add them back
            if (toBeReAdded.length) {
                me.selected.addAll(toBeReAdded);
            }
        }
    });
    And

    Code:
    Ext.override(Ext.view.AbstractView, {
        onMaskBeforeShow: function(){
            var me = this,
                loadingHeight = me.loadingHeight;
    
            me.getSelectionModel().deselectAll();
            me.all.clear();
            if (loadingHeight && loadingHeight > me.getHeight()) {
                me.hasLoadingHeight = true;
                me.oldMinHeight = me.minHeight;
                me.minHeight = loadingHeight;
                me.updateLayout();
            }
        }
    });

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