Results 1 to 4 of 4

Thread: Ext.selection.Model loses selection on page change [4.2.3]

    You found a bug! We've classified it as EXTJS-14421 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    219

    Default Ext.selection.Model loses selection on page change [4.2.3]

    Ext version tested:
    • Ext 4.2.3 rev 1414
    Browser versions tested against:
    • Chrome 36
    • IE 9
    • IE 10
    • FF 30
    Description:
    In a nightly built (probably of some months ago), the method onStoreRefresh() of class Ext.selection.Model has been changed from Ext.emptyFn to a complex method.
    The problem is that it now ignores the "pruneRemoved" parameter, so paging grids loses the selection when you change the page.
    Note:
    There is a check for "me.store.buffered", but that does not work for paging, it should instead check for "me.pruneRemoved" (this works also for paging, moreover you could have a buffered store with pruneRemoved=false).



    Steps to reproduce the problem:

    • Create a paging grid with CheckboxModel
    • Select some items in first page
    • Go to next page
    • Return to first page
    The result that was expected:
    • Items on first page are selected (selection is retained changing page)
    The result that occurs instead:
    • Items on first page are not selected (selection is lost changing page)
    Possible fix:

    Old code:
    PHP Code:
    if (me.store.buffered) {
        return;

    New code:
    PHP Code:
    if (!me.pruneRemoved) {
        return;


  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,450

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    219

    Default

    Reading source code of Ext 5 (5.0.1) it seems that the bug is the same: the check is done on "me.store.isBufferedStore" instead of "!me.pruneRemoved" (by the way it could have used "store" instead of "me.store").


    I found another bug in the same method: tell me if I have to report it separately.
    When removing the selected items no more available, the "for" loop must go backward else it will throw an exception if more than one record has to be removed.

    I fixed the code this way to make it work:
    Old code
    PHP Code:
    for (0length; ++i) { 
    New code
    PHP Code:
    for (length 1>= 0; --i) { 

  4. #4
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    219

    Default

    I see that in 5.0.2 nightly the code of this method has changed.
    In Release Notes there is Ticket EXTJS-14631 (SelModel pruneRemoved:false incorrectly removes records on store refresh), may be that it was a duplicate of this bug?

    Anyway:
    1. The check for isBufferedStore is still present (so that the pruneRemoved flag is ignored for Buffered Stores)
    2. There is still the inverted "for" loop bug

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
  •