Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: [FIXED][2.2.x/3.0] bug for selectRow in RowSelectionModel

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Nov 2007
    Location
    Centreville, VA
    Posts
    58

    Default [FIXED][2.2.x/3.0] bug for selectRow in RowSelectionModel

    If you select multiple rows in a grid and then click your mouse on one of those rows without holding down Ctrl or Shift, the expected behavior would be for the other selected rows to clear and the grid be left with just the newly clicked row as the selected row.

    Right now, the final mouse click is ignored.

    selectRow in RowSelectionModel begins with the following check:

    Code:
    if(this.locked || (index < 0 || index >= this.grid.store.getCount()) || this.isSelected(index)) return;
    I think this should be rewritten as:

    Code:
    if(this.locked || (index < 0 || index >= this.grid.store.getCount()) || (keepExisting && this.isSelected(index))) return;

  2. #2

  3. #3
    Ext User
    Join Date
    Nov 2007
    Location
    Centreville, VA
    Posts
    58

    Default

    I did search for this bug using 'RowSelectionModel selectRow keepExisting' but didn't find any posts. Good to know that it has already been found. Thanks.

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    It's tough searching for bugs I think. I didn't search but kind of remembered from memory. Track it back from here. If you agree it's a DUP then you might want to edit your post to say [DUP].

    http://extjs.com/forum/showthread.ph...000#post218000

  5. #5
    Ext User
    Join Date
    Nov 2007
    Location
    Centreville, VA
    Posts
    58

    Default

    Yeah, successfully searching for bugs in the forum is hit or miss. Looking at those links and where they lead, all the discussion is about the CheckboxSelectionModel and drag+drop causing problems.

    The problem described above occurs for a vanilla grid without drag+drop so it doesn't seem like a dup at least for those posts.

  6. #6
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    *** Bump ***

    Isn't it about time we fix this behaviour? It's simply not what users expect of singleSelect:false.

    Most obvious usecase:
    1. Create a grid with a RowSelectionModel with singleSelect:false.
    1. Selected all records (select first record, shift-click last record).
    2. Click any row (without pressing ctrl).
    Result: Nothing happens -- the user has no idea how to deselect the records.
    Expected result: All records get deselected except the clicked row.

    The complete override is:
    Code:
    Ext.override(Ext.grid.RowSelectionModel, {
    	selectRow : function(index, keepExisting, preventViewNotify){
    		if(this.isLocked() || (index < 0 || index >= this.grid.store.getCount()) ||
    			(keepExisting && this.isSelected(index))) return;
    		var r = this.grid.store.getAt(index);
    		if(r && this.fireEvent("beforerowselect", this, index, keepExisting, r) !== false){
    			if(!keepExisting || this.singleSelect){
    				this.clearSelections();
    			}
    			this.selections.add(r);
    			this.last = this.lastActive = index;
    			if(!preventViewNotify){
    				this.grid.getView().onRowSelect(index);
    			}
    			this.fireEvent("rowselect", this, index, r);
    			this.fireEvent("selectionchange", this);
    		}
    	}
    });
    @mjlecomte: This is not a duplicate as far as I could see. The only other thread mentioning this problem is marked as a duplicate of this thread.

  7. #7
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Moving this thread to the 3.0 Bugs section hoping it will get more attention there...

  8. #8
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    Agreed. In fact I thought I fixed this a while back. Must have never committed it.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  9. #9
    Ext JS Premium Member
    Join Date
    Jun 2009
    Location
    Eastern WA, US
    Posts
    78

    Default

    Did this ever get fixed?

  10. #10
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Yes, it's fixed in 2.3 and 3.0.0.

Page 1 of 2 12 LastLast

Posting Permissions

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