You found a bug! We've classified it as EXTGWT-3134 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2011
    Location
    Arizona
    Posts
    64
    Vote Rating
    0
    jdkida is on a distinguished road

      0  

    Default Tree/ListView/Grid Selection Appearance and Event not consistent

    Tree/ListView/Grid Selection Appearance and Event not consistent


    When you click on a row and hold down the mouse button and then let go of the mouse button on another row, it does not fire a selectionEvent but it does highlight the row. This is different behaviour then gxt2.

    This is deceiving as you think you clicked that row since it is highlight, but no selection event is ever fired.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    89
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


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

    The behavior may end up being different from 2.x, but as discussed in IRC the view and internal state and events must all be internally consistent. Click events don't actually fire if you don't mouseup in the same element as the mousedown, so it may be expected to lose that selection when the mouse is used, but if that is the case, the style should not be applied.

    We'll update this thread with any progress or workaround.

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    6
    Vote Rating
    0
    aryzhov is on a distinguished road

      0  

    Default


    With GXT 3.0.6 I observed a slightly different, but still buggy behavior in Tree when using MULTISELECT mode: Select a range of nodes, then click inside the selected range -- the selection change event is not fired. This is a serious bug. By examining source code, I was able to make a workaround for this problem:

    Code:
    // for Tree
    tree.setSelectionModel(new TreeSelectionModel<MyTreeModel>() {
      @Override
        protected void onMouseDown(NativeEvent e) {
          super.onMouseDown(e);
          mouseDown = false;
        }
    });
    
    // for Grid
    grid.setSelectionModel(new GridSelectionModel<MyGridModel>() {
      @Override
      protected void handleRowMouseDown(RowMouseDownEvent event) {
        super.handleRowMouseDown(event);
        mouseDown = false;
      }
    });
    I don't use ListView but a similar fix can be applied to it as well. Another way to patch it is to extend Tree and Grid and to apply the fix in the constructor.

    The bug is caused by incorrect value of the mouseDown variable in selection model. In each of the mouse down handlers, it's set to true in the beginning of the method, and it's set to false in the very end, but in some cases there is a return statement in the middle which leaves the variable set to true. This variable is then used to determine whether a selection change event should be deferred, and the incorrect value leads to lost selection events.

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2011
    Location
    Arizona
    Posts
    64
    Vote Rating
    0
    jdkida is on a distinguished road

      0  

    Default


    Colin helped me to locate the following workaround that worked in FF
    Code:
    grid.setView(new GridView<Ticket>() {
        @Override
        public void focus() {
            focusImpl.focus(focusEl);
        }
    });

Thread Participants: 2