Results 1 to 7 of 7

Thread: Grid selection in 4.0.3

  1. #1
    Ext GWT Premium Member
    Join Date
    Mar 2010
    Posts
    73

    Default Grid selection in 4.0.3

    I'm having trouble when I select a row in a grid, it is not highlighted.

    In GridSelectionModel::onRowClick() - fireSelectionChangeOnClick is always false.

    I've tracked it up the call stack to the following method in GridView.

    Code:
    public boolean isSelectableTarget(Element target) {
      //some other code
    
        if (cell != null) {
          // Remember to turn on cell selection in the case of text & label cells 
          // Handle selection must return true to allow cell editing 
          return cell.handlesSelection();
        }
    
    
        return true;
      }
    Be default, cell.handlesSelection() returns false so fireSelectionChangeOnClick is never set.

    If I override this method and replace it with the implementation from 4.0.2, grid rows select on click correctly.

    This seems like a really bad workaround, so if you could provide a little direction/insight, it would be greatly appreciated.

  2. #2
    Ext GWT Premium Member
    Join Date
    Mar 2010
    Posts
    73

    Default

    I found the issue. We were extending AbstractCell without overriding handlesSelection().

  3. #3
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    Nice job finding the issue. Thanks for the feedback on it.

  4. #4
    Ext GWT Premium Member
    Join Date
    Aug 2010
    Location
    Germany, Solingen
    Posts
    281

    Default

    Quote Originally Posted by branflake2267 View Post
    Nice job finding the issue. Thanks for the feedback on it.
    Running into the same issue after upgrading to GXT 4.0.3.

    Think, it would be nice to find a hint in the release notes or documentation that the handlesSelection method have to be overriden to get the selection model working or instead set the default return value in AbstractCell to true.

  5. #5
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    Thanks for your feedback. Good idea. I'll update the release notes, and send out some updates.

  6. #6
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Posts
    4

    Default

    Running into the same issue too!

    Default return value should be true and not false. Selection on numeric columns is totally broken. Should i now subclass every number cell?

  7. #7
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    Sorry for the delay. There are two ways to override it. Subclassing every cell, or overriding the GridView.isSelectableTarget. If you subclass the GridView.isSelectableTarget and change the logic to always true, you won't have to worry about handling it in the cell. That said, there is one other case where handlesSelection is used, but you shouldn't see the need to change it, based on the component, and that is in the Grid's onBrowser event loop.

Similar Threads

  1. Replies: 1
    Last Post: 21 Nov 2013, 10:42 AM
  2. Replies: 1
    Last Post: 24 Jan 2012, 11:53 AM
  3. Replies: 2
    Last Post: 23 Mar 2011, 1:18 PM
  4. Replies: 1
    Last Post: 28 Aug 2008, 7:53 AM

Posting Permissions

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